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

Is it correct to say that due to garbage collection feature in java, a java program never goes out of memory?

0 Answers  


Difference between hashCode() & equals()?

3 Answers   HCL,


Which class has no duplicate elements?

8 Answers  


Why unicode is important?

0 Answers  


Why does java have different data types for integers and floating-point values?

0 Answers  






What’s the difference between constructors and other methods?

0 Answers  


How many threads does a core java have?

0 Answers  


Is constructor inherited?

0 Answers  


What is Three tier architecture. Can anyone explain with a Ordinary web application Project? (JSP,Servlets,JAVA,DAO) ?

3 Answers   TCS,


What's the difference between an abstract class and interface in java?

0 Answers  


How many bits are in a sentence?

0 Answers  


What is the use of coding?

0 Answers  


Categories