Share on Google+Share on Google+

Virender Saini
1 Answer(s)      6 years and 2 months ago
Posted in : Java Beginners

Hi,,plz give me explanation of upcasting and downcasting using reference with examples.

View Answers

September 1, 2011 at 3:43 PM

Upcasting is the conversion of data type from lower range data type to higher data type eg: int to long, byte to long, int to double etc.

Downcasting is the casting from a general to a more specific type, i.e. casting down the hierarchy.eg: double to byte, long to int etc.

For more information,

Visit Here


Related Tutorials/Questions & Answers:
Double To Int Without TypeCasting
Double To Int Without TypeCasting  How to convert Double to Int without using typecasting?   class ConvertDoubleToInt { public static void main(String[] args) { double d=25.5; int num=new
type casting - Java Beginners
type casting and conversion  I am beginner and my query is Importance of type casting and conversion  Hi friend,public class TypeCasting{ public static void main(String[] args){ boolean t = true; byte b = 2; short s
Theory - Java Beginners
typecasting is used otherwise explicit typecasting is used. b)Any positive integer
Change case in C language
toupper() and strupr() but having typecasting error. Thanks in advance Ankita
Regarding Login application program
is not initializing myform Logf=(myform)form; And while typecasting
Convert Char To Byte
by typecasting and then print the value at the console. Here is the code
Convert Hexa To Char
the char value which the convert in char number by typecasting. Type casting
Java clone method example
the typecasting that needed to assign the generic object to a reference of my class
Introduction to Generics in Java
are typecasting the String into Integer at runtime it will give you error. So, using
PHP Type Juggling
of implicit typecasting is if we add two integer variables then the result is integer


Advertisement null