Explicit and Implicit Casting Between Data Types in Java

preview_player
Показать описание
Explicit and Implicit Casting Between Data Types in Java

Casting Source Code
----------------------------------------------------------------------------------------------------------------------------------------

Console Projects
----------------------------------------------------------------------------------------------------------------------------------------

JAVA Console Games
----------------------------------------------------------------------------------------------------------------------------------------

JAVA Game JAPPLET JAR Archives
----------------------------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------------------------------------

Рекомендации по теме
Комментарии
Автор

Perfect. just what I was looking for. I like the way you broke it down and included the text "slides" in between.

strited
Автор

GREAT video ! I would humbly add 1 comment; I think that at 3:58 of the video you explain that you're "demoting the INT to a DOUBLE", but I think you have the objects switch - I think you MEANT to state that you're "demoting the DOUBLE to an INT", thereby trimming all of the decimal places off the DOUBLE, so that it is now a more primitive INT :-) ...

ME? I find using the terms "upgraded" and "downgraded" instead of "promoting" and "demoting" are more intuitive for my students...

IMPLICIT Casting then is understood as "something done by a COMPILER, typically the on-the-fly "upgrade" of a more PRIMITIVE object to a more COMPLEX object in order to complete an operation amongst objects" - your example of the Java compiler on-the-fly "upgrading" the "Height" object to a DOUBLE in order to make it compatible for the necessary operation (multiplication) with the other object "Mass" :-) . Thus we see Implicit Casting is may be "specified" by the CODER (human), simply by NOT specifying any EXPLICIT casting, and this leave the actual Object Datatype Conversion responsibility to the COMPILER...

EXPLICIT Casting then is understood to be the CODER (human) "specifying" in his/her code what conversions the Compiler should be performing, thereby removing ANY AMBIGUITY over what datatype any given object is; and Explicit (Object Datatype) Casting most often takes the form of a coder creating an "upgraded" version of a more primitive object in order to grant it additional superpowers :-) ...

ANOTHER useful way to look at casting is this: you're building a NEW object with MORE capabilities out of the "DNA" of a more primitive object...

Cheers!
-Mark in North Aurora

markevogt
Автор

now i am clear with the difference between you :)

jayshree
Автор

Thank you for the video, you are a good man.

rickynincompoop
Автор

Bitte. Ich hoffe, dass es für Sie nützlich ist.

OneByteAtATime
Автор

Well, that was perfect thanks for all of ur efforts

minadief
Автор

@Pawel yea, I think he meant that as well (demoting double to int). I thought I was the only one that was confused by that lol

xRuNiTzGhozTx
Автор

basically the one where u use the (bracket) thing is explicit and without (bracket) implicit

mehulsahni
Автор

Yes. He probably meant demoting double to int..

secondBluesM
visit shbcf.ru