Mind map
Chapter 2
Map content
Chapter 2
Primatives
- Numbers
- Byte (8 bit) SMALLEST
- Short (16 bit)
- int (32 bits)
- long (64 bit) LARGEST
- int (32 bits)
- Short (16 bit)
- Decimals
- float (32 bit)
- double (64 bit)
- float (32 bit)
- Byte (8 bit) SMALLEST
- char (single Unicode character)
- boolean (T/F)
- Numbers
Variables
- Reference Types (contains object reference)
- Primitive Type (contains primitive)
- Primitive Conversions
- Widening Conversion (converting to type of same size or larger)
- Narrowing Conversion (converting to type with smaller size)
- may cause data loss
- Primitive Conversions
- Sun's Naming Con: start lowercase, no symbols
- Constants (unchangeable/static variables)
- use "final" to deem constant
- Literals
- convention of declaring types and values of variables
- Primitive Literals
- used for int, short, long, byte
- Long type literals need "L" at end of value
- i.e. long a = 123456789L
- Float (use f or F at end of value)
- Character Literals (char encased in single quotes)
- Can use \ to make escape sequences
- E.X. \b (backspace) \t (tab) \" (quotes)...
- Can use \ to make escape sequences
- Long type literals need "L" at end of value
- used for int, short, long, byte
ASCII
- 7 bit characters
Unicode
- 8, 16, and 32 bit characters
- Seperators
- () method signatures, expressions, conversions, loops
- {} type declaration, array creation, blocks
- [] array declaration, array value dereferencing
- <> pass parameterized types
- ; terminate statements, for loop conditions
- . separates package names
- ; terminate statements, for loop conditions
- <> pass parameterized types
- [] array declaration, array value dereferencing
- {} type declaration, array creation, blocks
- () method signatures, expressions, conversions, loops
Operators
- Unary
- only one operand
- - + ++ -- ! ~
- only one operand
- Arithmatic
- + - * / %
- % Modulus (returns remainder of division)
- + - * / %
- Conditional/Relational
- == != (for int, float, bool, char)
- < > <= >=
- && (and)
- || (or)
- ? : (uses three expressions)
- expr1 ? expr2 : expr3
- expr1 must be boolean
- if expr1 TRUE, return expr2
- if expr1 FALSE, return expr3
- ? : (uses three expressions)
- || (or)
- == != (for int, float, bool, char)
- Shift/Logical
- << >> >>>
- shifts int place depending on left or right shift
- << >> >>>
- Assignment
- += -= *= ....
- Other
- Unary normally converts to int
- use type in () to stop conversion
- Unary normally converts to int
- Unary
Information
- Description
- Mind Map on Chapter 2, created by Devin Downs on 19/06/2020.
- Created by
- Devin Downs
- Views
- 1
- Rating