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 |
The following program is Overloading or Overriding? public class PolymorphismEx { public int sampleMethod(int a) { return a; } public String sampleMethod(int a) { return "Is it Overloading or Overriding???"; } }
4 Answers Ness Technologies, TCS,
If an object is garbage collected, can it become reachable again?
List out benefits of object oriented programming language?
class a extends b { } class b extends a { } why java doesn't support cyclic pls explain me with example
Can we extend the String class?
what is actual real time using of oops concepts in projects(Interface,polymorphism.abstraction.........)
How java is platform independent?
41 Answers College School Exams Tests, Infosys, TCS,
Infinite loop using while ?
What is hashset in java?
What is the difference between reader/writer and inputstream/output stream?
What is the minimum and maximum length of an identifier?
transaction attributes ?