Why should we create an object? what is a need of it?
Apart from access members of a class i want what is a need
of object what does it contain??
In normal class to access any member of thaht class we
create object where as for static class we access its
members using class name. what is a difference between them...
thanks in advance.



Why should we create an object? what is a need of it? Apart from access members of a class i want w..

Answer / suresh

we may or maynot create object is our wish as per the application requirement
class = our body
methods=works ie; walk,,talk,think......
objects=body parts ie; hands ,legs,eyes....

we have to do any work like walking(method) with legs(object) which connected to ourbody(class)
so object is necessary if we do work ourself

wecall method without using objects that is by using classname followed by methodname
ie we do our works with others just mention our name

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More Core Java Interview Questions

what is the reason behind non static method cannot be referenced from a static Context?

2 Answers  


How do you write methodology?

0 Answers  


What is identifier in java?

0 Answers  


What are the 8 primitive data types in java?

0 Answers  


What will happen if non-synchronized method calls a static synchronized method and what kind of lock it acquires?

0 Answers  






What is difference between protected and private?

0 Answers  


What is the difference between actual and formal parameters?

0 Answers  


Name the method that used to clear the buffer ?

2 Answers  


Why java is a platform independent? Explain

0 Answers  


Differentiate between stringbuffer and stringbuilder in java.

0 Answers  


What is the epoch date?

0 Answers  


If a method is declared as protected, where may the method be accessed?

0 Answers  


Categories