Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


What is casting?

Answers were Sorted based on User's Feedback



What is casting?..

Answer / kabita

Casting is used to convert the value from one datatype to
another datatype

Is This Answer Correct ?    7 Yes 0 No

What is casting?..

Answer / 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

What is casting?..

Answer / janet

Casting is used to convert the value of one type to another

Is This Answer Correct ?    1 Yes 0 No

Post New Answer



More Core Java Interview Questions

Why declare Main() method as a static in java ?

0 Answers   HCL,


what is the output ? Math.floor(-2.1) a)2 b)-2 c)-3.0 d)0

4 Answers   Accenture,


Can we call the Thread.sleep in Synchyronozed block?

5 Answers   Logica CMG,


What is the differences between heap and stack memory in java? Explain

0 Answers  


Can we declare an interface as final?

0 Answers  






Does java support Operator Overloading?

0 Answers   Flextronics,


Explain restrictions for using anonymous inner classes?

0 Answers  


Can we assign null to double in java?

0 Answers  


1.what is the exact difference between applet and frame? 2.Do we use main method in frames?

5 Answers  


Difference between this() and super() in java ?

0 Answers  


What is the difference between jsp and servlet?

6 Answers   Symphony,


What modifiers are allowed for methods in an interface?

0 Answers  






Categories