Thursday, January 22, 2015

Chapter 3: Variables (Fixed)

(above is the result of compiling the dog code)

Fundementals of Variables in Java:
  • There are several variable types in Java:
Float
Int
Double
Bool
Byte
Short
Long
Char
  • Float's use decimal values (ex: .25, .111, .8)
  • Int or Intiger uses full number values (ex: 1, 5, 25)
  • Doubles combine BOTH Float and Int values (ex: 1.25, 3.49, 6.64)
  • Bool or Boolean Variables use either True OR False (ex: While True, do this...)
  • Byte variables are 8-Bit variables, used to save memory in large arrays (ex: byte a = 100 , byte b = -50)
  • Small variables are 16-Bit and used to help conserve data. Its Minimum and Max value are -32,768, and 32,768
  • Long variables are 64-Bit and are also used to conserve data. Its minimum and Max values are - 2,147,483,648 and 2,147,483,648 
  • A char variable is a variable that uses a charector (ex. A, B, C, D)



No comments:

Post a Comment