Computer Science Programming Language
Java
- Developed by Sun Micro-Systems
- First programming language that wasn't tied to an operating system or hardware
- General purpose programming language
JVM (Java Virtual Machine)
- Programs are compiled into Bytecode
- The Java Virtual Machine is an interpreter that executes Bytecode
Programs
- Every program must have at least one class
- All other code is inside that class
- Program always begins executing at the
mainmethodmainmust always be defined in the same way
Data Types
| Keyword | Size | Description | Value |
|---|---|---|---|
| byte | 1 byte | Byte-length integer | $-128$ to $127$ |
| short | 2 bytes | Short integer | $-32768$ to $32767$ |
| int | 4 bytes | Integer | $-2147483648$ to $214748364$ |
| long | 8 bytes | Long integer | $-2^{63}$ to $2^{63} - 1$ |
| float | 4 bytes | Single-precision floating point | |
| double | 8 bytes | Double-precision floating point | |
| char | 2 bytes | A single character | All characters |
| boolean | N/A | A Boolean value | True or false |