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
What are wrapped classes in java programming?
What is java in simple terms?
What is finally and finalize in java?
What is object in java?
What is the structure of java?
Is java util list serializable?
what is the difference between preemptive scheduling and time slicing? : Java thread
What do you mean by ordered and sorted in collections in java?
What is the main advantage of passing argument by reference?
Can an interface be final?
Can we override the static method?
Detail discussions on JVM, memory management and garbage collector.
Can we change the value of static variable?
Why deletion in linkedlist is fast than arraylist?
can used Protected Class outside Function.?