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
Explain when classnotfoundexception will be raised ?
How to declare an arraylist in java?
Why hashset is used in java?
How do I convert a numeric ip address like 192.18.97.39 into a hostname like java.sun.com?
Define nashorn in java8.
What are identifiers in java?
What is the console in java?
What is the difference between class forname and new?
What is the function of compareto in java?
What will happen to the exception object after exception handling?
What are classloaders?
What is substring 1 in java?
What is object in java?
What does escaping a character mean?
What are computer functions?