Mindmap
Language Fundamentals
Inhalt der Mindmap
Language Fundamentals
Encoding Sets
- Unicode is a character set that represents more than 65,000 characters and used by many programming languages
- Problem: so much data to transfer --> encoding allows us to use Unicode when writing comments, identifiers, characters, and strings. UTF-8 is the most popular
- ASCII (American Standard Code for Information Interchange) character set is the standard character set and represents 128 characters
- Unicode is a character set that represents more than 65,000 characters and used by many programming languages
Primitives
- 8 different data types that are used to represent numbers, characters, and specific phrases
- byte, short, int, long, float, and double all represent integers or decimals
- char contains a single character like 'd', '&' ,or '4'
- boolean returns either true or false
- 8 different data types that are used to represent numbers, characters, and specific phrases
Variables
- Variables represent data and must have a declared type
- Reference types refer to objects and primitive type
- Variables also have a name (can't be a Java keyword, boolean, or null)
- Declare a variable by writing the type followed by the name and a semicolon
- int rowCount; or char c;
- Can combine variables with the same type by separating with a comma
- int a, b; = int a; int b;
- Possible to assign value at the same time as you declare a variable
- int rowCount = 100;
- Variables represent data and must have a declared type
Constants
- Constants are variables that have values that can't be changed
- Declare a constant using keyword 'final'
- Constants are all uppercase with words separated by underscores
- final int ROW_COUNT = 50;
- Constants are all uppercase with words separated by underscores
- Declare a constant using keyword 'final'
- Constants are variables that have values that can't be changed
Literals
- Integer Literals
- Assign values to primitives: byte, short, int, and long
- Can't assign value to a literal when it's outside the allowed values
- byte b = 200; doesn't work because byte can go from -128 to 127
- Can't assign value to a literal when it's outside the allowed values
- Written in decimal(base 10), base 16, or base 8
- 2 or int x = 2;
- 1_000_000
- Assign values to primitives: byte, short, int, and long
- Floating-point Literals
- 0.2, .2, 7.33, 0.7 e^12
- Consists of: whole number part, decimal part, fractional part, optional exponent
- Two types: Float = 32 bits // Double = 64 bits
- use f or F to create a float, if not, automatically becomes a double
- 8.f or 0.5f // 12.53
- use f or F to create a float, if not, automatically becomes a double
- Character Literals
- A single character enclosed in single quotes
- 'a' // '%' // 'R'
- Escape sequenses can't be entered using the keyboard but can be represented with a character literal
- '\b' = backspace character // '\t' = tab character // '\\' = backslash
- A single character enclosed in single quotes
- Boolean Literals
- Returns two values: true and false
- Integer Literals
Informationen
- Beschreibung
- Mindmap am Language Fundamentals, erstellt von Julianna Pettey am 27/09/2020.
- Erstellt von
- Julianna Pettey
- Aufrufe
- 0
- Bewertung