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.
Answer Posted / 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 View All Answers
Define how destructors are defined in java?
Tell us something about different types of casting?
What does 3 dots mean in java?
What is the purpose of the file class in java programming?
Difference between start() and run() method of thread class?
How do I print a “?
Which data type is a class in java?
How list contains works in java?
How do you use parseint in java?
What do you mean by constructor?
What is an example of declaration?
What is a java developer salary?
What is the replace tool?
What is the difference between class forname and new?
What best practices should you follow while writing multithreaded code in java?