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
how is final different from finally and finalize in java?
What is flush buffer?
What is ascii code?
What do you know about the garbage collector?
Explain oops concepts in detail?
What is exception in java?
What is lambda programming?
State some advantages of java?
Why do we need hashmap in java?
Can we call the run() method instead of start()?
describe method overloading
Does importing a package imports its sub-packages as well in java?
How many types of equations are there?
What is a consumer in java?
What is string and example?