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 |
Explain the differences between public, private, protected and static?
Does treeset use compareto?
if am have 100 threads(for ex:T1,T2---T100) how we give priority to these threads and how the system excute these threads
Implement 2 stacks with just 1 array. The stack routines must not indicate overflow unless every slot in array is used.
What is the core java?
How do you sort data in java?
What is anonymous class?
How to change value in arraylist java?
How we can skip finally block of exception even if some exception occurs in the exception block in java?
Why is the main method static in Java?
What is the difference between logical data independence and physical data independence?
What is java in simple terms?