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 code optimizations techniques you follow in general practice?

2 Answers   Accenture, TCS, Wipro,


What are the advantages of exception handling?

0 Answers  


Can you call a private data from an inner class?

6 Answers  


Why do we use predicate in java?

0 Answers  


What are the Static and Dynamic Variables? Differentiate them.

0 Answers   CGI,






Why is java multithreaded?

0 Answers  


What is meant by object?

0 Answers  


How can we create a object of a class without using new operator.

1 Answers   Infosys, Nokia,


What is the final access modifier in java?

0 Answers  


Which class is extended by all other classes?

4 Answers  


What is a get method?

0 Answers  


How would you convert bytes to string?

0 Answers  


Categories