Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is casting?

Answer Posted / vijayakumar chinnasamy

Casting mostly used for converting value from one data type
to another data type.Mostly used for convert incompatible
data.

eg:

WRRONG
long a=20; // a is 64bit(long) data
int b=10; // b is 32 bit data.
b=a; // u r trying to assign 64bit data into 32 bit data

CORRECT
long a=20; // a is 64bit(long) data
int b=10; // b is 32 bit data.
b=(int)a; // ur converting 64bit data into 32bit data
then assign to variable b.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is split return?

1082


Where local and global variables are stored?

1126


Explain illegalmonitorstateexception and when it will be thrown?

1154


What are thread safe functions?

986


Which package is always imported by default?

1142


How concurrent hashmap works?

1237


What are data types in programming?

1036


What is difference between add() and addelement() in vector?

1580


How many ways can you break a singleton class in java?

1024


What do you mean by jjs in java8?

1060


How do you define a variable?

992


Which collection does not allow duplicates in java?

1025


What is the difference between abstraction and encapsulation?

1089


How do you compare arrays in java?

996


Is constructor inherited?

1009