Java is an Object-Oriented Programming Language.
- Platform Independent
- Secure
- Robust
- Portable
- Multithreaded
- JDK – Java Development Kit (includes compiler + libraries)
- JRE – Java Runtime Environment
- JVM – Java Virtual Machine
| Type | Example | Size |
|---|---|---|
| byte | 127 | 1 byte |
| short | 32000 | 2 bytes |
| int | 10 | 4 bytes |
| long | 9999999L | 8 bytes |
| float | 3.14f | 4 bytes |
| double | 3.14159 | 8 bytes |
| char | 'A' | 2 bytes |
| boolean | true/false | 1 bit |
| Category | Operators |
|---|---|
| Arithmetic | + - * / % |
| Relational | < > <= >= == != |
| Logical | && || ! |
| Assignment | = += -= *= /= |
| Increment/Decrement | ++ -- |
| Ternary | (condition) ? value1 : value2 |
| Concept | Meaning | Example |
|---|---|---|
| class | Blue print | class Student{} |
| Object | Real instance | Student s1=new Student(); |
| Encapsulation | Binding data + method | private fields+public getter sheter method |
| Abstraction | Hiding details | use abstract class/interface |
| inheritance | reause code from parent | class dog extend Animal |
| polymorphism | same method diffrent use | Method overloading and overriding |
| this | Refers to curent object | this.datatype |
| Interface | Class Examples |
|---|---|
| List | ArrayList, LinkedList |
| Set | HashSet, TreeSet |
| Map | HashMap, TreeMap |