For my degree project I am trying to write a simple messaging system for the shift I supervise at work to communicate outside of work across the internet. It will display a shift rota for the day and also they can send messages to each other, asynchronously. However i am failing miserably to code it. It is suppose to work on RMI
The message system has three classes, message, messageOperator, messageOperatorHolder and an interface MessageOperatorInterface This is the code for message
An this is the code for messageOperator
And then this is the messageOperatorHolder
When I compile it I get cannot use non-static method to reference static context.
I know this means that I am referencing the class messageOperator rather than an instance. But I need a system that will allow me to create messageOperators.
A little help? will need help the server in future if any one has got the time?
Originally posted by Al Dodd: When I compile it I get cannot use non-static method to reference static context.
More of a beginner's question if you are getting THAT error message.
Why are you using HashTable and Enumeration rather than more modern classes? Why have you got a void getMessages() method? Why are you not calling your classes by the correct names starting with a Capital Letter? Then you would realise that you are calling instance methods on the name of their type (the class name) rather than on the name of an object.