Mapa mental
Literals
Conteúdo do 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."
Informações
- Descrição
- Mapa Mental sobre Literals, criado por Abdelkrim ZAHMOUNI em 04-10-2018.
- Criado por
- Abdelkrim ZAHMOUNI
- Visualizações
- 0
- Histórico
-
- Criado por Abdelkrim ZAHMOUNI · 23 set 2018
- Copiado por Abdelkrim ZAHMOUNI · 3 out 2018
- Copiado por Abdelkrim ZAHMOUNI · 3 out 2018
- Copiado por Abdelkrim ZAHMOUNI · 3 out 2018
- Copiado por Abdelkrim ZAHMOUNI · 4 out 2018
- Avaliação