Mapa mental
Pages 25-39
Contenido del mapa
Pages 25-39
character encoding increases efficiency of storing and transmitting unicode text
- character encoding = data compression
- Unicode Consortium endorses three types of character encoding systems
- UTF-8
- used when unicode is transformed to variable lengths of bytes
- UTF-16
- all commonly used characters fit into a single 16-bit code unit
- UTF-32
- uses 32 bits for every single character. Much data, not used for internet applications
- UTF-8
- Unicode
Java uses ASC2 for almost all input elements except comments, identifiers, and the insides of strings/characters
Separators
- (); {}; []; <>; ; ;:,;.
Primitives
- byte; short; int; long; float; double; char; boolean
- bytes contains a whole number b/t -128 and 127
- a byte is 8 bits so 256 possible values.
- An int can store up to # 1000000
- Use different values for storage purposes. byte uses the least amount of memor. int uses more and long even more
Variables
- variables are data placeholders
- 2 types: reference types and primitive types
- reference types points toward an object
- primitive types hold a primitive
- 2 types: reference types and primitive types
- identifiers are an unlimited length sequence of java letters/numbers
- must begin with a Java letter. Must not be a Java keyword/boolean/or null literal. It must be unique
- variables are data placeholders
Java Letters and Digits
- Include uppercase and lowercase ASCII Latin letters
- Declare a variable by writing the type first then the name plus a semicolon
- Can declare multiple variables on same line: int a, b;
- Variable names should be short and meaningful. Lowercase first then Uppercase: dogCat
Constants
- use final to assign a value to a variable which you don't want changed
Literals
- literal = source code representation of a value
- 3 types: primitive types, string literals, null literal
- 4 types of primitive literals: integer literals, floating point literals, character literals, boolean literals
- Integer Literals
- decimal = base 10; hexadecimal = base 16; octal = base 8
- used to assign values to bytes, short, int, and long
- When assigning a value to long be sure to use L after the number: long a = 0900L. otherwise it registers as an int
- Floating-Point Literals
- Floating-Point: a whole number part. a decimal point. A fractional part. An optional exponent
- Float or Double. Float = 32 bits. Double = 64 bits
- Floating-Point: a whole number part. a decimal point. A fractional part. An optional exponent
- Boolean Literals
- Two literals = true and false
- Character Literal
- enclosed in single quotes
- escape characters: "\n"
- Integer Literals
- 4 types of primitive literals: integer literals, floating point literals, character literals, boolean literals
- 3 types: primitive types, string literals, null literal
- literal = source code representation of a value
Primitive Conversions
- identity conversion: conversion from a type to the same type
- Always succesful
- Widening conversion and narrowing conversion: conversion from a type to another type
- Not always sucessful
- Widening Conversion
- converts from small type to an equal size type or a larger type: int to long
- No information loss
- converts from small type to an equal size type or a larger type: int to long
- Narrowing Conversion
- converts from a large type to a smaller type: long to int
- need to specify the target type in parentheses: long a = 10; int b = (int) a;
- may incur information loss
- converts from a large type to a smaller type: long to int
- identity conversion: conversion from a type to the same type
Operators
- performs an operation on 1, 2 or 3 operands: x + 4. The + is the operator
- Operators that require only 1 operand are unary operator
- binary = 2 operands
- six categories: unary operators, arithmetic operators, relational and conditional operators, shift and logical operators, assignment operators, and other operators
Información
- Descripción
- Mapa Mental sobre Pages 25-39, creado por Gary Jones el 30/05/2019.
- Creado por
- Gary Jones
- Visitas
- 0
- Valoración