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


Please Help Members By Posting Answers For Below Questions

What are inbuilt functions in java?

666


Why is java multithreaded?

635


What is an infinite loop?

633


Why is java so popular?

726


What is "this" keyword in java? Explain

768






How to declare objects of a class ?

692


State the difference between strings and arrays.

710


Difference between static synchronization vs. Instance synchronization?

679


How does the java compiler work?

614


What do you understand by the term polymorphism?

719


What is a layout manager and what are different types of layout managers available in java awt?

815


What does three dots mean in java?

750


Define inheritance with reference to java.

669


Explain different ways of creating a thread?

612


What is singleton service?

592