Typecasting

Typecasting

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:
Typecasting
Typecasting
Advertisements
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
Date type typecasting - Java Beginners
SCJP Module-6 Question-12
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
this variable into byte by typecasting and then print the value at the console. Here
Convert Hexa To Char
. After that takes the char value which the convert in char number by typecasting
Java clone method example
return you the typecasting that needed to assign the generic object
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

Ads