Answer Posted / vikram aditya
When reference variable of super class refers to the object of sub class that mechanism is known as Up-casting.
Ex:
A a=new B();
When reference variable of sub class refers to the object of super class that mechanism is known as Down-casting.
Ex:
B b=(B) a;
//Where A is super class and B is subclass
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
How can we find the actual size of an object on the heap?
What is runtime polymorphism or dynamic method dispatch?
Is arraylist sorted in java?
Do loops java?
What are the files generated after using IDL to java compiler?
What is a blocking method in Java?
Add a value x to array from index l to r where 0 <= l <= r <= n-1
What is main difference between variable and constant?
How do you convert int to char in java?
What is lifetime variable?
What is an argument java?
Does chrome use java?
What is formatted output?
Differece between class and generic class?
What is static synchronization?