what is meant by UP& DOWN casting in java?

Answer Posted / regalla soujanya naresh reddy

A super class reference can be converted into a subclass
reference but this
subclass reference is not useful to call the methods of any
of the classes. This convention is known as Downcasting.

We can convert the subclass reference to a superclass
reference without using the cast operation compiler because
it will internally take care of the casting. This is known
as Upcasting.

Is This Answer Correct ?    9 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is jpa specification?

766


What is character in data type?

763


I want to re-reach and use an object once it has been garbage collected. How it's possible?

802


What is a programming object?

803


What is a parameter used for?

760


What is arraylist class in java?

755


describe synchronization in respect to multithreading? : Java thread

733


Give differences between Quicksort &Mergesort. When should these sorts be used andwhat is their running time in java?

979


Can we call a non-static method from inside a static method?

802


What is size of int in java?

822


What are the two types of streams offered by java 8?

712


Explain parallel processing in java8?

922


How can an object be unreferenced?

792


can I implement my own start() method? : Java thread

774


Can you override static methods?

752