0

Whats the difference between parsing and casting in Java?

27th Dec 2019, 12:59 AM
VĂ­ctor MartĂ­nez
2 Answers
+ 1
Not sure if that was Java specific topic. Just as I understand it, when someone mention "parsing" they usually be talking about text or string. Parsing is like breaking down a big bulk of data in order to obtain the useful information and discard the "wrapping bag" as they are not important. Casting kinda remind me of magical movies/books. You know, when the witch/wizard is angry s/he can cast a spell on someone and turn them into a frog, a rodent or something else. It's pretty much the same in coding, you (the witch/wizard) can cast a data of a certain type into another type. Mind though, you should take care about compatibility, some types are just much too diiferent that casting one into another is just plain silly as it makes no sense, unlike magic spells where you are free to cast them into whatever you please : )
27th Dec 2019, 3:43 AM
Ipang
0
Thank you so much :)
27th Dec 2019, 4:56 PM
VĂ­ctor MartĂ­nez