| Author |
Difference between casting and conversion in Java
|
nidhivel raja
Ranch Hand
Joined: Jun 26, 2008
Posts: 36
|
|
Hi all , Can anyone please tell me what is the difference between Casting and Conversion in Java?Thank you in advance
|
 |
Martijn Verburg
author
Bartender
Joined: Jun 24, 2003
Posts: 3268
|
|
|
I found this to be a fairly good explanation.
|
Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
With casting, you are not modifying the object. The result of the cast is still the exact same object, just with a difference type of reference pointing to it: With conversion, you are taking the source object and (in most cases) returning a new object based on the old one:
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
bob david
Greenhorn
Joined: Nov 27, 2008
Posts: 4
|
|
type casting , explaining with example : roseindia.net/java/beginners/... type conversion : go4expert.com/forums/showthre...
|
bob david123
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
Bob, can you please finish that second link? It doesn't point anywhere valid right now, and if I just go to the forum I have to do a search there. I might as well link to our own search. And moving to beginners.
|
 |
 |
|
|
subject: Difference between casting and conversion in Java
|
|
|