Mapa mental
Literals
Contenido del mapa
Literals
Literal Values
- Integer Literals
- Decimal Literals
- Octal Literals: 06
- Hexadecimal Literals: 0xFFFFl
- Floating-Point Literals: 11301874.9881024
- Boolean Literals: true, false
- Character Literals: 'a', '\u004E'
- String Literals: "Word"
Strings: Immutable Objects
- special area of memory called the "String constant pool."
- Existing Strings simply have additional references,
- The reason why String is immutable and marked final is to not cause problems in the pool
- String s = new String("abc"); // creates two objects, and one reference variable
- StringBuffer and StringBuilder
- Exactly the same API except StringBuilder is not thread safe: its methods are not synchronized: StringBuilder will run faster
- StringBuilder append(String s)
- StringBuilder insert(int offset, String s)
- StringBuilder delete(int start, int end)
- StringBuilder reverse()
- String toString()
- chained methods: x.concat("def").toUpperCase().replace('C','x')
- String API
- char charAt(int index)
- String concat(String str)
- int length()
- boolean isEmpty()
- String replace(char oldChar, char newChar)
- String substring(int beginIndex[, int endIndex])
- String trim()
- String to(Lower|Upper)Case()
- boolean equalsIgnoreCase(String anotherString)
- special area of memory called the "String constant pool."
Información
- Descripción
- Mapa Mental sobre Literals, creado por Abdelkrim ZAHMOUNI el 04/10/2018.
- Creado por
- Abdelkrim ZAHMOUNI
- Visitas
- 0
- Historial
-
- Creado por Abdelkrim ZAHMOUNI · 23 sep 2018
- Copiado por Abdelkrim ZAHMOUNI · 3 oct 2018
- Copiado por Abdelkrim ZAHMOUNI · 3 oct 2018
- Copiado por Abdelkrim ZAHMOUNI · 3 oct 2018
- Copiado por Abdelkrim ZAHMOUNI · 4 oct 2018
- Valoración