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 is extension method in java?
What do you mean by synchronized non access modifier?
Is empty .java file name a valid source file name?
What is the syntax and characteristics of a lambda expression?
A non-static inner class may have object instances that are associated with instances of the class’s outer class. A static inner class does not have any object instances.
Is 0 a real number?
Explain restrictions for using anonymous inner classes?
Can a constructor have different name than a class name in java?
What are different exception types exceptions available in java ?
How do you override a variable in java?
What is the range of a character variable?
Why main method is called first in java?
Give the difference between the println method and sqrt method?
How many ways can an argument be passed to a subroutine and explain them?
What is array initialization in java?