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
What do you mean by formatting?
How to restrict a member of a class from inheriting by its sub classes?
What is __ init __ functions?
Is there any case when finally will not be executed?
What is break and continue statement?
Explain working of call by reference function invoking.
What is oop in java?
Is space a string in java?
Is intellij better than eclipse?
What are the object and class classes used for?
Can you override a final method?
How java uses the string and stringbuffer classes?
Is java still relevant?
What is the method in java?
Can we have try block without catch block?