+ 1
What is an object in Java
Java
4 odpowiedzi
+ 20
an instantiation of a class
+ 3
- An object is an instance of a class.
- Objects are created and eventually destroyed (I mean that they live in the program for a limited time) and i can change it's properties.
EX:
Suppose we have a class called Shape that have methods and attributes.
- attributes like : color - Length and so on.
- methods like : draw (How i draw that shape?)
An instance of the Shape class would be a specific Shape like circle, Rectangle or Square.
+ 2
@Yassine Rajjaf
Yes, you are right
I just give him an example :)
http://www.programmerinterview.com/index.php/java-questions/difference-between-object-and-class/
0
@Nayra Adel, that's not true. That depends on the interface the object exposes. I can make one that retrieves information only, or have no props at all!