What is casting?
Answers were Sorted based on User's Feedback
Answer / kabita
Casting is used to convert the value from one datatype to
another datatype
| Is This Answer Correct ? | 7 Yes | 0 No |
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 |
Answer / janet
Casting is used to convert the value of one type to another
| Is This Answer Correct ? | 1 Yes | 0 No |
Can a class have multiple constructors?
Can an integer be null java?
What is static synchronization?
difference between byte stream class and character stream class?
what is the purpose of class "Object" which is base class for all classes?
Can we sort arraylist in java?
String class is defined under which package in java?
why we write public static void main (String args[]) in core java plz explain briefly??????????????????
How many types of threads are there in java?
How to stop a thread in java? Explain about sleep () method in a thread?
Difference between this() and super() ?
i don't want fullforms of JDK an JVM i want definitions for them