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
Difference between static and dynamic class loading.
Does java initialize arrays to zero?
What is a JAR file?
How is string stored in java?
What is size () in java?
Is age discrete or continuous?
Can private members of a base class are inheritable justify?
How can you traverse a linked list in java?
What are the steps in the jdbc connection?
What is difference between string and stringbuffer?
What are the basic interfaces of java collections framework?
how to split string in java?
What is the final field modifier?
What is Java Shutdown Hook?
Why string is immutable with example?