Java Fundamentals
April 29, 2017
Categorised in: Java Core
Principles of Java
- Simple
- Objected-Oriented
- Robust
- Methods, functions and properties
- Code in small chunks – easy to debug
- Portable
- High Performance
- JVM has improved
- Dynamic, interpreted and threaded
- Run-time interpretation
- Apps can do more than one thing at a time
- Compatibility between different data types
Software Stack
- Operating System — Windows / Linux / Mac
- Java Virtual Machine (JVM) — Android / IBM / Sun microsystems
- Core runtime and additional libraries — JDK / JRE
- Compiled ByteCode
Java v/s C++
Java | C++ |
---|---|
Not compatible with prev. languages | Compatible with C |
Compiled to bytecode | Compiled to native machine language |
Calls to native functions go through JNI | Allow direct calls to native system libraries |
Write once, run anywhere | Write once, compile anywhere |
Runs in a protected virtual machine (JVM) | Low-level system functions |
Managed memory access | Explicit memory management and pointers |
Limited single inheritance | Multiple inheritance |
Note:
- JNI (Java Native Interface) is sometimes referred to as Genie
- In Java memory is managed by itself
Java v/s JavaScript
Java | JavaScript |
---|---|
Not compatible with prev. languages | Based on ECMAScript standard |
Compiled to bytecode | Not compiled — interpreted at runtime |
Calls to native functions go through JNI | No native function calls in browser |
Write once, run anywhere | Compatibility with every browser |
Runs in a protected virtual machine (JVM) | Restricted to browser window |
Managed memory access | Managed memory access |
Inheritance through class | Inheritance through prototype |
Java Editions
- Standard Edition (SE)
- Enterprise Edition (EE)
- Micro Edition (ME)
- for sensors, mobile devices and micro-controllers. E.g. Sim-Cards
Note:
- JRE includes JVM and is not required by default
- JRE must be updated regularly as security issues are common
- Mobile systems have their own Java Runtime
- JDK includes compilation and packaging (important for command line execution)
- java: runtime
- javac: compiler
- javadoc: docs builder
- jar: archive builder
Pratik Kataria is currently learning Springboot and Hibernate.
Technologies known and worked on: C/C++, Java, Python, JavaScript, HTML, CSS, WordPress, Angular, Ionic, MongoDB, SQL and Android.
Softwares known and worked on: Adobe Photoshop, Adobe Illustrator and Adobe After Effects.