What is upward and downward casting in Java?

Showing Answers 1 - 4 of 4 Answers

Dhananjay Singh

  • Oct 25th, 2005
 

In upward casting small datatype is casted in to big data type such as byte is casted as int type.but in downward casting the big data type is casted into small data type such as long is casted into int or byte.

  Was this answer useful?  Yes

Sergei

  • Nov 1st, 2005
 

Upward it is when from one type to superclass which is not nessesary.Downward when From superclass to subclass.

  Was this answer useful?  Yes

Rajesh Sakhamuri

  • Nov 2nd, 2005
 

In java casting are 2 types.1)upcasting,2)downcasting;

"upcasting" is nothing but the conversation of data from smaller type to larger type.

"downcasting" is nothing but the convertion of the required data from larger type to smaller type.

  Was this answer useful?  Yes

rizwan

  • Aug 1st, 2006
 

what sergei told is right .sorry to tell but both of u have given wrong answer. the answer what u told is for specific cast and explict cast

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions