Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- There are 2 categories of types:
- Primitive Types
- - Built into the language
- - Always start with a lowercase letter
- - The only primitive types are
- - byte (-128 to 127)
- - short (-32,768 to 32,767)
- - int (-2b to 2b)
- - long (-9t to 9t)
- - float (decimal value :: 32 bits)
- - double (decimal value :: 64 bits)
- - char (a single character)
- - boolean (true or false)
- Reference Types
- - Created by developers via classes
- - Should always start with uppercase letter
- - Creating new reference types is extremely common
- There are 3 categories of variables:
- Class Variables
- - Belongs to the class, not objects
- - Defined in the class
- - Static
- Instance Variables
- - Belongs to an object
- - Defined inside a class
- - Non-static
- Local Variables
- - Belongs to a method/constructor
- - Can access instance/class variables
- - Cannot be accessed outside of the method
Advertisement
Add Comment
Please, Sign In to add comment