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

Explain the transient field modifier?

569


What is synchronization and why is it important in java programming?

475


What is the numeric promotion?

509


When do we use synchronized blocks and advantages of using synchronized blocks?

669


How can we make a class virtual?

648






What is map and hashmap in java?

629


What is use of super keyword?

571


What is a war file?

555


How does enum work in java?

552


Which package is used for pattern matching with regular expressions?

650


Considering notepad/ie or any other thing as process, what will happen if you start notepad or ie 3 times? Where 3 processes are started or 3 threads are started?

661


Which is the best approach for creating thread ?

729


What is the generic class?

535


Is array serializable java?

528


What is collection api?

614