Bookmark Topic Watch Topic
  • New Topic

Very dumb question..back to basics...  RSS feed

 
Vinod Vinu
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Report post to moderator
Got confussed between object of a class and thread of a class. Please explain me for my following questions:-

1) what is the difference between an object of a class and a thread of a class ?
2) Are object and thread not same in java?
3) Don't you think that both are behaving similalry in some or other way ?
4) How the threads are created (before or after loading the class)?


Thanks for your precious time.
 
Greg Charles
Sheriff
Posts: 3015
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Report post to moderator
An object is like a hand puppet, and the thread is the hand that makes it move. These aren't homework problems, are they? We frown on people asking us to do their homework for them.
 
Vinod Vinu
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Report post to moderator
An object is like a hand puppet, and the thread is the hand that makes it move.


please elaborate it with some real life example.

thanks
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Report post to moderator
Vinod Vijay wrote:
An object is like a hand puppet, and the thread is the hand that makes it move.


please elaborate it with some real life example.

http://www.youtube.com/watch?v=az01K8bLbG0
 
Vinod Vinu
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Report post to moderator
I asked the explanation with some e.g. as one given by Greg Charles and not any link of any creaping video.


Darryl Burke - This is completely not appreciable.
you should be shamfull of what you have done. Don't be so egostic. You should share your knowledge. Neither it won't harm you and nor it will reduce the part of your knowledge.
Kindly take care of that in future.
 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Report post to moderator
All kidding aside. Like Greg already said, this sounds very much like homework questions. I would like to refer you to our policy regarding homework (here). And even if it's not homework then you should ShowSomeEffort and at least try to answer the questions yourself.
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Report post to moderator
Vinod Vijay wrote:a thread of a class ?

A thread of a class? That's the first time I heard that expression.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator
Objects and threads are two totally different things. They are not the same, and don't really have anything to do with each other.

An object is a block of data in the computer's memory. Objects have a type (the class that the object is created from). You can call the methods defined in the corresponding class on an object, to do something with the data inside the object. Have a look at Learning the Java Language in the Java Tutorials to understand the basics of object oriented programming.

A thread is a "live" path of execution in the program. Your program can start multiple threads, to do multiple things at the same time. See Concurrency in the Java Tutorials to learn what threads are. They don't have any direct link to objects.
 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
  • Report post to moderator
Vinod Vijay wrote:

This is completely not appreciable.

It's funny, though. Lighten up.
 
Campbell Ritchie
Marshal
Posts: 56578
172
  • Mark post as helpful
  • send pies
  • Report post to moderator
By "appreciable" you presumably mean "acceptable".

I am going to pull rank, and stop any further potential arguments. I am not going to take sides, but simply close this thread.
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!