• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Static Methods in RMI RemoteInterface

 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm now building the RMI RemoteInterface where I have to give the methods of the server that the client can use.

But in the server I have many static methods which gives out an error as I add them to the interface.


As I remove the static from them, I get the error


So shall I remove the static variables & methods from the entire server class ?
Or how shall I proceed ?
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you have SCJP/OCPJP certification? Then you should know static methods can not be added to an interface. You should also know that you can access static members from an instance method, but accessing instance members from a static method will give you a compiler error.
 
Bartender
Posts: 2418
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Ray buddy,
I recommend you to read Terry and Andrew Monkhouse's SCJD study guide for reference. It is very helpful and it provide some information about RMI.
You can also visit Oracle's tutorial about RMI.

reply
    Bookmark Topic Watch Topic
  • New Topic