Java Video Tutorial 3: Variables and Arithmatic (Part1)
Uploader Comments (aphonik)
Top Comments
-
Thanks! this really helped me out! and btw, i love your accent! :D
-
HAHAHA byte myVariable!!!
thanks for the vid!
All Comments (62)
-
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!
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.
=]
aphonik 5 years ago 2
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?
5h4rk 5 years ago
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 =]
aphonik 5 years ago