What is JVM? Explain architecture of java in detail along with suitable block diagram?

 Java Virtual Machine

The main feature of Java is WORA. WORA stands for Write Once Run Anywhere. The feature states that we can write our code once and use it anywhere or on any operating system. Our Java program can run any of the platforms only because of the Java Virtual Machine. It is a Java platform component that gives us an environment to execute java programs. JVM's main task is to convert byte code into machine code.

JVM, first of all, loads the code into memory and verifies it. After that, it executes the code and provides a runtime environment.


2nd part 



  • Java source code is compiled into bytecode by the Java compiler. Bytecode is not executable code for the target machine rather it is the object code of java virtual machine (JVM). This bytecode will be stored in class files. During runtime, this bytecode will be loaded, verified and JVM interprets the bytecode into machine code which will be executed in the machine in which the Java program runs.
  • Classloader loads all the class files required to execute the program. Classloader makes the Class program secure by separating the namespace for the classes obtained through the network from Tak the classes available locally. Once the bytecode is loaded successfully, the next step is bytecode verification by bytecode verifier.
  • The bytecode verifier verifies the byte code to see if any security problems are there in the code.
  • It checks the byte code and ensures the following.
- The code follows JVM specifications.
- There is no unauthorized access to memory.
- The code does not cause any stack overflows.
- There are no illegal data conversions in the code such as float to object references. 

  • Once this code is verified and proven that there are no security issues with the code, JVM will convert the byte code into machine code which will be directly executed by the machine in Thi which the Java program runs. JVM is the simulated computer within a real computer. This is the "PL component that makes java programming language platform-neutral. All operating systems mo have this JVM that is responsible for generating executable code from bytecode generated by "st java compiler. If the operating system does not incorporate JVM, we can install it.
  • You might have noticed the component "Just in Time" (JIT) compiler in the above figure. This is a component that helps the program execution to happen faster. As we discussed earlier when the Java program is executed, the byte code is interpreted by JVM. But this interpretation is a slower process. To overcome this difficulty, JRE includes the component JIT compiler. JIT makes the execution faster. 
  • Once the bytecode is compiled into that particular machine code, it is cached by the JIT compiler and will be reused for future needs. Hence the main performance improvement by using the JIT compiler can be seen when the same code is executed again and again because JIT makes use of the machine code which is cached and stored.

                                     OR,
Java Architecture

Java Architecture is a collection of components, i.e., JVM, JRE, and JDK. It integrates the process of interpretation and compilation. It defines all the processes involved in creating a Java program. Java Architecture explains each and every step of how a program is compiled and executed.
Java Architecture can be explained by using the following steps:
  • There is a process of compilation and interpretation in Java.
  • Java compiler converts the Java code into byte code.
  • After that, the JVM converts the byte code into machine code.
  • The machine code is then executed by the machine.
The following figure represents the Java Architecture in which each step is elaborate graphically.


Now let's dive deep to get more knowledge about Java Architecture. As we know that the Java architecture is a collection of components, so we will discuss each and every component into detail:-

Components of Java Architecture

The Java architecture includes the three main components:
Java Virtual Machine (JVM)
Java Runtime Environment (JRE)
Java Development Kit (JDK)

Java Virtual Machine

  • The main feature of Java is WORA. WORA stands for Write Once Run Anywhere. The feature states that we can write our code once and use it anywhere or on any operating system. Our Java program can run any of the platforms only because of the Java Virtual Machine. It is a Java platform component that gives us an environment to execute java programs. JVM's main task is to convert byte code into machine code.
  • JVM, first of all, loads the code into memory and verifies it. After that, it executes the code and provides a runtime environment.

Java Runtime Environment

  • It provides an environment in which Java programs are executed. JRE takes our Java code, integrates it with the required libraries, and then starts the JVM to execute it. 

Java Development Kit

  • It is a software development environment used in the development of Java applications and applets. Java Development Kit holds JRE, a compiler, an interpreter or loader, and several development tools in it.  
These are the three main components of Java Architecture. The execution of a program is done with all these three components.

Comments

Popular posts from this blog

Suppose that a data warehouse for Big-University consists of the following four dimensions: student, course, semester, and instructor, and two measures count and avg_grade. When at the lowest conceptual level (e.g., for a given student, course, semester, and instructor combination), the avg_grade measure stores the actual course grade of the student. At higher conceptual levels, avg_grade stores the average grade for the given combination. a) Draw a snowflake schema diagram for the data warehouse. b) Starting with the base cuboid [student, course, semester, instructor], what specific OLAP operations (e.g., roll-up from semester to year) should one perform in order to list the average grade of CS courses for each BigUniversity student. c) If each dimension has five levels (including all), such as “student < major < status < university < all”, how many cuboids will this cube contain (including the base and apex cuboids)?

Suppose that a data warehouse consists of the four dimensions; date, spectator, location, and game, and the two measures, count and charge, where charge is the fee that a spectator pays when watching a game on a given date. Spectators may be students, adults, or seniors, with each category having its own charge rate. a) Draw a star schema diagram for the data b) Starting with the base cuboid [date; spectator; location; game], what specific OLAP operations should perform in order to list the total charge paid by student spectators at GM Place in 2004?

Explain network topology .Explain tis types with its advantages and disadvantges.