What is the difference(or similarity if there are some)
between object and a variable?

Answer Posted / dipty

A variable can hold asingle type of variable at a time..but an object can hold a number of variables of different type.

int a = 4; // a would be the variable
Car b = new Car();// b is an object
b.carGo();// this is an method in the object car created below.
class Car()
{
void carGo()
{
car moves;
}
}

Is This Answer Correct ?    14 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are wrapped classes in java programming?

589


What is java in simple terms?

565


What is finally and finalize in java?

594


What is object in java?

536


What is the structure of java?

508






Is java util list serializable?

537


what is the difference between preemptive scheduling and time slicing? : Java thread

535


What do you mean by ordered and sorted in collections in java?

554


What is the main advantage of passing argument by reference?

505


Can an interface be final?

550


Can we override the static method?

578


Detail discussions on JVM, memory management and garbage collector.

556


Can we change the value of static variable?

502


Why deletion in linkedlist is fast than arraylist?

537


can used Protected Class outside Function.?

614