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 / 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 |
Can we assign integer value to char in java?
What are the different types of garbage collectors in java?
Why main method is called first in java?
Is null a string?
What is a parameter in matrices?
What are triggers in DB? Explain their types. How do they work?
What is an array and a vector? How they different from each other?
Compare overloading and overriding?
Difference between Preemptive scheduling vs. Time slicing?
What is computer compiler?
Can i have abstract class with no abstract methods?
what is an virtual function