-1

apologies if this is an easy question, I have a java class that implements Serializable

  public class product extends UnicastRemoteObject implements Serializable

I wish however to use threading within the same class, can anyone point me in the right direction please it would be much appreciated.

** apologies please notice the change above

TotalNewbie
  • 1,004
  • 5
  • 13
  • 25
  • What's your question, exactly? Why can't you just use threading the way you normally would? – Epiglottal Axolotl Feb 22 '14 at 22:53
  • What do you want to use threading for? Is the class likely to be in-use by other threads while being serialized? What do threading or serialization have to do with the title of your question? – Mike Samuel Feb 22 '14 at 22:53
  • Your question doesn't make sense. "Using threading within a class" doesn't mean anythingconcrete. Multithreading and serialization are completely orthogonal concepts. Also, a class starts by an uppercase letter in Java. – JB Nizet Feb 22 '14 at 22:54
  • TotalNewbie: it looks like you want to use RMI and multithreading, although you don't have basic Java knowledge like the rules for inheritance and the naming conventions yet. Start with basic things. Multithreading is probably the most complex matter in programming. It's too early for you to mess with multithreading. – JB Nizet Feb 22 '14 at 23:04
  • @JBNizet, that's a naming convention, which is generally good to be respected, but you are not forced to do so. – Lajos Arpad Feb 22 '14 at 23:30

1 Answers1

4

You have two choices , either :

public class product implements Serializable,Runnable { }

or

public class product extends Thread implements Serializable {}

Evdzhan Mustafa
  • 3,645
  • 1
  • 24
  • 40