What are the differences between typecasting and data conversion?
Christopher Schultz TypeCasting is a feature of the language whereby you are telling the compiler (and readers of your source code :-) that you explicitly want it to treat the object as if it were really of the type that you specified rather than it's actual type.Typecasting:
Data conversion is physically changing one chunk of data into another, often with interpretation.
The difference can be illustrated thus:
This allows you to cast the type ofObject o = new String("1234"); String myString = (String)o;
oto it's proper type,
This converts theString o = new String("1234"); Integer i = Integer.parseInt(o);
String"1234" into the Integer which represents the value 1234 (one thousand two hundred twenty four).