Why use Java? Is Java 100% object oriented? What does Java comprise of? What is the main difference between the Java platform and the other software platforms? How would you differentiate JDK, JRE, JVM, and JIT?
Q. Why use Java?
A. One needs to use the best tool for the job, whether that tool is Java or not. When choosing a technology to solve your business problems, you need to consider many factors like development cost, infrastructure cost, ongoing support cost, robustness, flexibility, security, performance, etc.
Java provides client technologies, server technologies, and integration technologies to solve small scale to very large scale business problems.
- Firstly, Java is a proven and matured technology used in many mission critical projects, and there are millions of developers world wide, thousands of frameworks, tools, and libraries for it, and millions of sites, blogs, and books to find relevant information.
- The emergence of open-source technologies has truly made Java a powerful competitor in the server and integration technology space. You can always find a proven framework that best solves your business problems.
- The platform also comes with a rich set of APIs. This means developers spend less time writing support libraries, and more time developing content for their applications.
- Built-in support for multi-threading, socket communication, and automatic memory management (i.e. automatic garbage collection).
Q. Is Java 100% object oriented?
A. No. Is Java 100% OO? if yes why? if not, why not.
Q. What does Java comprise of?
- Java language comprising the syntax and semantics for programming has 3 editions – Java SE (Standard Edition), Java ME (Micro Edition), and Java EE (Enterprise Edition).
- Java API (Application Programming Interface) is nothing but a set of classes and interfaces that come with the JDK. All these classes are written using the Java language and contains a library of methods for common programming tasks like manipulating strings and data structures, networking, file transfer, etc. The source *.java files are in the src.zip archive and the executable *.class files are in the rt.jar archive. There are 3 types of APIs available in Java technology.
- Java Virtual Machine (JVM) is where all the classes written using the Java language and the API run on. The Java classes and API are platform independent but the JVM is not platform independent. You will find different downloads of the JVM for each Operating System (OS).
Q. What is the main difference between the Java platform and the other software platforms?
- Java source code is compiled into byte code that is understood by the JVM. Byte codes are the machine language of the JVM. The source code is easy for humans to understand. This enables a programmer to write programs. The byte code is very difficult for humans to understand. The first four bytes of every Java class (i.e the byte code) file are specified to be 0xCAFEBABE, a magic number that can help tools quickly differentiate likely class files from non class files.
- Java Virtual Machine (JVM) – is a software that can be ported onto various hardware platforms. JVM interprets Java programs that have been compiled into byte code and usually stored in a “*.class” file. Byte code can be run on any computer that has Java interpreter (i.e the JVM). The JVM converts the byte code into platform (i.e. OS) specific executable machine language – a language understood by computers (i.e. binary 0s and 1s). The machine language is almost impossible for humans to understand. Every OS has its own machine language.
Q. How would you differentiate JDK, JRE, JVM, and JIT?
A.There is no better way to get the big picture than a diagram.
Next post covers byte code conversion, flavors of JVMs, and JVM run time arguments:
- Is it possible to convert byte code into source code?
- What are the 2 flavors of JVM?
- What are the 2 bits of JVM?
- What are some of the JVM arguments you have used in your project?
- How do you monitor the JVMs?