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 is the difference between serial and throughput garbage collector?
What is the difference between yield() and sleep()?
What is the use of arrays tostring () in java?
What are internal variables?
Can a variable be local and static at the same time?
What is java util?
Explain public static void main(string args[]) in java.
explain local datetime api in java8?
What is the abstract class?
Convert a BST into a DLL and DLL to BST in place.
What is update method called?
What is variable and its types?
Is a case study a method or methodology?
What is instance means in java?
What is a linkedhashmap java?