• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to make a java class as mutithreaded?  RSS feed

 
Ranch Hand
Posts: 588
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anyone explain how to make a simple java class as multithreaded?
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All instances of classes are multi threaded, it depends on how it manages being multithreaded. Is this what you are asking?
[ September 24, 2008: Message edited by: David O'Meara ]
 
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I presume you have read the Java Tutorials?
 
jacob deiter
Ranch Hand
Posts: 588
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this what you are asking?


As per my understanding,servlet are multithreaded,servlet container will take care of all threading stuff,but a single pojo without any container can be mutithreaded(for example,class A can be mutithreaded).

class A
{
}

Please correct if I am wrong
[ September 24, 2008: Message edited by: jacob deiter ]
 
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by David O'Meara:
All instances of classes are multi threaded


but every java class's main method has single object called singleton right? please clarify me

 
Campbell Ritchie
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by seetharaman venkatasamy:
but every java class's main method has single object called singleton right?
Where on earth did you find that?

No, the main method is not usually associated with an object; that is why it is marked "static."
The main method may contain references to objects, but not usually singletons. Whoever told you that was mistaken.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
THANKS CAMBPELL . I GOT IT
 
Campbell Ritchie
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!