Java Type Casting Tutorial

Java Type Casting Tutorial

FavoriteLoadingAdd to favorites

Free preview of my Java course:

Java468x60

I recommend installing Codota autocomplete on your IDE (free):

This is how you cast a variable in java. β˜•

int a = (int) b;

Simply put the type you want it to be in parentheses. That’s it! Java will now cast your variable to be the variable type you want.

I hope this helps you with java type casting! This is great practice πŸ™‚

I hope you enjoyed java type casting tutorial!

—————————————————————————————— –

Free tips and programs:
Programmer Humor: – Promo code: “ALEX10” for 10% off

Recommended Channels to Subscribe to
Career Karma:
TheNewBoston:

~

(2nd channel)

Alex Lee

source

By |2021-01-31T12:08:54+00:00January 31st, 2021|Java Video Tutorials|37 Comments

37 Comments

  1. Aaqiel Behardien January 31, 2021 at 12:08 pm - Reply

    Alex my guy, if you did not exist my Java knowledge would be non-existent! Please keep making videos.

  2. derandi January 31, 2021 at 12:08 pm - Reply

    awesome explanation!

  3. Clara Leo January 31, 2021 at 12:08 pm - Reply

    Omg.

  4. James Arden January 31, 2021 at 12:08 pm - Reply

    excellent explanation

  5. R4Reviews January 31, 2021 at 12:08 pm - Reply

    Thank you so much my brother!I really appreciate your teaching..It helps me a lot..Take care man !

  6. Rizlan snowgirl January 31, 2021 at 12:08 pm - Reply

    It was nice,do you have Facebook?

  7. Ayush Solapurkar January 31, 2021 at 12:08 pm - Reply

    AP CSA gang!!

  8. md abdool January 31, 2021 at 12:08 pm - Reply

    Do you type cast and Array the same way ?

  9. shubhavi January 31, 2021 at 12:08 pm - Reply

    thank u sm

  10. Archan Bhattarai January 31, 2021 at 12:08 pm - Reply

    Please make a video about Generics.

  11. Vincent LIU January 31, 2021 at 12:08 pm - Reply

    so helful!

  12. Muhammad Hassan January 31, 2021 at 12:08 pm - Reply

    Thank you so much for making this vid helped me so much!

  13. gverweijen January 31, 2021 at 12:08 pm - Reply

    What about casting objects? I just learned that when you store an object in an ArrayList, you have to 'cast' it back into itself to use the function display(Graphics g) inside it.

  14. cowabunka January 31, 2021 at 12:08 pm - Reply

    I just finished CodeCademy's course on java
    And i consider your tutorials the next grind
    very informative and natural as far as my progression is concerned
    certainly glad i found your vids before jumping into the deep end

  15. Asher Manangan January 31, 2021 at 12:08 pm - Reply

    ty

  16. Ben Smith January 31, 2021 at 12:08 pm - Reply

    How about turning off the background music ; really distracting. Other than that, thank for the video.

  17. baljeet singh January 31, 2021 at 12:08 pm - Reply

    Do you code on Mac or PC?

  18. Tiago Bial January 31, 2021 at 12:08 pm - Reply

    you teach better that my professor.

  19. keyword kali January 31, 2021 at 12:08 pm - Reply

    Thank you for posting this! I just started a coding bootcamp a few weeks ago and it was really helpful to hear about this differently than how I heard it in class.

  20. AdolfJames Urian January 31, 2021 at 12:08 pm - Reply

    How do you get a string from an input? I tried this but when i tried it, i made a scanner, and what i wanna do is if the input string matches to something like "help" It will run command so i did input == "help" If state ment but its not running the command inside it, it returns to false

  21. Zain Nadeem January 31, 2021 at 12:08 pm - Reply

    For peers who want to understand even better you can visit this website its easy to digest as well. https://www.w3schools.com/java/java_type_casting.asp

  22. Niccster10 January 31, 2021 at 12:08 pm - Reply

    OOOOOH. When i saw people typecasting graphics to graphics2d i had NO idea what was going on

  23. Erick Peculiar January 31, 2021 at 12:08 pm - Reply

    thank you so much your videos are very helpful

  24. Matt Smith January 31, 2021 at 12:08 pm - Reply

    By "round down", do you really mean "truncate"?

  25. Rashid akhter January 31, 2021 at 12:08 pm - Reply

    O man, I was looking for it.
    Thank you

  26. VorticyHP January 31, 2021 at 12:08 pm - Reply

    nice! i finished the first playlist! i learned so much and it was easy to follow!

  27. thepenguinftw January 31, 2021 at 12:08 pm - Reply

    boolean is primitive also

  28. Mobarak Jama January 31, 2021 at 12:08 pm - Reply

    Dis video was β˜•οΈβ˜•οΈβ˜•οΈβ˜•οΈβ˜•οΈβ˜•οΈβ˜•οΈβ˜•οΈβ˜•οΈβ˜•οΈ

  29. Joe Thompson January 31, 2021 at 12:08 pm - Reply

    Great tutorial on casting Alex!!

  30. sandeep sekhon January 31, 2021 at 12:08 pm - Reply

    β˜•

  31. JohnnyTheBot January 31, 2021 at 12:08 pm - Reply

    Yo who was the person that disliked this video?

  32. WaterRocket January 31, 2021 at 12:08 pm - Reply

    These have been such a great refresher before the AP test. Ive learned some new things while watching your videos. Thanks to your tutorial I now have a chance of passing.

  33. Excilon January 31, 2021 at 12:08 pm - Reply

    I found this video when I was having trouble with this. Thanks a lot. Could you do a video on java libraries and frameworks

  34. Cent 02 January 31, 2021 at 12:08 pm - Reply

    Been here since 50 subs πŸ˜›

  35. Odai January 31, 2021 at 12:08 pm - Reply

    Well, thanks alot man I’ll be watching lots of your videos now because i need to improve!! β˜•οΈβ˜•οΈβ˜•οΈβ˜•οΈβ˜•οΈ

  36. Paul J January 31, 2021 at 12:08 pm - Reply

    hey alex, can you post vids on java projects? β˜•β˜•β˜•β˜•β˜•β˜•β˜•

  37. Kily January 31, 2021 at 12:08 pm - Reply

    Any tips on learning programming?

Leave A Comment

*