Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Java Video Tutorial 3: Variables and Arithmatic (Part1)

Loading...

Sign in or sign up now!
68,348
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Oct 6, 2006

Part 1 will describe how to declare and assign variables in java aswell as discussing the various data types.

Part 2 shows you how to perform simple arithmatic and display variables through an example program.

Category:

Howto & Style

Tags:

License:

Standard YouTube License

  • likes, 7 dislikes

Link to this comment:

Share to:

Uploader Comments (aphonik)

  • There is no difference in those two statements, both the variables hold a value of 50. Only the data type differs. Bytes can hold values from -128 to 127. Int's can hold numbers from -2,147,483,648 to 2,147,483,647. So if I wanted to hold a value of 1 billion (1,000,000,000) I wouldn't be able to store that in an byte. I would however be able to store it in an int.

    =]

  • So, if I want to store 100, it is recommendable to use byte instead of int? Or Short for 500? Thus we can save space on the memory? Is that right?

  • That is correct, you will save memory space. However, just make sure you don't store a value thats higher than the maximum the data type can hold - or some strange stuff will happen =]

Top Comments

  • Thanks! this really helped me out! and btw, i love your accent! :D

  • HAHAHA byte myVariable!!!

    thanks for the vid!

see all

All Comments (62)

Sign In or Sign Up now to post a comment!
  • Please use a real editor. Newcomers who see this video will think that Notepad is acceptable as a programmer's editor and never find personal fulfillment.

  • You assigned myFloat twice?

    Even though they're two data types wouldn't it cause confusing if you called them for a argument?

  • Nice vid, but bump up the sound on ur mic plz :D

  • and what is char used for im soooo lost...i should just watch em all b4 asking questions

  • wat is boolean used for like idk wat is true or false like watever u mean omg its so hard to say ummm welll....fail;

  • bite myvariable lol =]

  • thank you for the videos! keep it up!

  • Thank you very much for your tutorials! I learned a whole lot today!

View all Comments »
Loading...

0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more