JAVA Beginners part 1

Java program is mostly a collection of objects talking to other objects by invoking
each other’s methods. Every object is of a certain type, and that type is defined by a
class or an interface. Most Java programs use a collection of objects of many different
types.

In the Java programming language, all source code is first written in plain text files ending with the .java extension. Those source files are then compiled into .class files by the javac compiler. A .class file does not contain code that is native to your processor; it instead contains bytecodes — the machine language of the Java Virtual Machine1 (Java VM).
The java launcher tool then runs your application with an instance of the Java Virtual Machine.

j1

The Java platform has two components:

The Java Virtual Machine
The Java Application Programming Interface (API)

Java Virtual Machine is the base for the Java platform and is ported onto various hardware-based platforms.
The API is a large collection of ready-made software components that provide many useful capabilities. It is grouped into libraries of related classes and interfaces; these libraries are known as packages.

The Java Virtual Machine, or JVM, is an abstract computer that runs compiled Java programs. The JVM is “virtual” because it is generally implemented in software on top of a “real” hardware platform and operating system. All Java programs are compiled for the JVM. Therefore, the JVM must be implemented on a particular platform before compiled Java programs will run on that platform.

What makes the JVM lean and mean?

The JVM is lean because it is small when implemented in software.

The “virtual hardware” of the Java Virtual Machine can be divided into four basic parts:
the registers, the stack, the garbage-collected heap, and the method area. These parts are abstract, just like the machine they compose, but they must exist in some form in every JVM implementation.

The JVM has a program counter and three registers that manage the stack.
It has few registers because the bytecode instructions of the JVM operate primarily on the stack. This stack-oriented design helps keep the JVM’s instruction set and implementation small.

The JVM uses the program counter, or pc register, to keep track of where in memory it should be executing instructions.

The method area is where the bytecodes reside. The program counter always points to (contains the address of) some byte in the method area. The program counter is used to keep track of the thread of execution. After a bytecode instruction has been executed,
the program counter will contain the address of the next instruction to execute.

what will you do in JAVA?

Write a source code file, compile it using javac compiler and then run the bytecode on a JVM.

Note –  I will be adding newer posts with further versions like 2 , 3 etc till i have learned JAVA well. This is my way of making notes

Head First Java 2nd Edition

SCJP_Sun_Certified_Programmer_for_Java_6

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s