Advertisement
ipwxy

Categories of Types & Variables

Jun 29th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. There are 2 categories of types:
  2. Primitive Types
  3. - Built into the language
  4. - Always start with a lowercase letter
  5. - The only primitive types are
  6. - byte (-128 to 127)
  7. - short (-32,768 to 32,767)
  8. - int (-2b to 2b)
  9. - long (-9t to 9t)
  10. - float (decimal value :: 32 bits)
  11. - double (decimal value :: 64 bits)
  12. - char (a single character)
  13. - boolean (true or false)
  14.  
  15. Reference Types
  16. - Created by developers via classes
  17. - Should always start with uppercase letter
  18. - Creating new reference types is extremely common
  19.  
  20. There are 3 categories of variables:
  21. Class Variables
  22. - Belongs to the class, not objects
  23. - Defined in the class
  24. - Static
  25. Instance Variables
  26. - Belongs to an object
  27. - Defined inside a class
  28. - Non-static
  29. Local Variables
  30. - Belongs to a method/constructor
  31. - Can access instance/class variables
  32. - Cannot be accessed outside of the method
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement