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
Why are the methods of the math class static?
What is diamond operator in java?
Why does java not support operator overloading?
When do we use synchronized methods in java?
When will we use them?
Can final class have constructor?
Explain the purpose of garbage collection in Java?
Is java programming easy?
What is the symbol for space?
What language is an assembler written in?
What is static in java?
What are filterstreams?
Can we catch more than one exception in single catch block?
Is there any case when finally will not be executed?
Explain the reason behind ending a program with a system.exit(0)?