A Learning Journey

–By Sharing Knowledge

Archive for the ‘Chapter-II’ Category

What is Java and Why is Java

What is Java and Why is Java

Posted by krishnamm on February 6, 2009


 Why Java treated as a Object Oriented?

As we discussed previously, in OOP, everything acts as an object.Also JAVA adopt to the OOPs concepts like data encapsulation,abstraction,Inheritance,Polymorphism.

So it’s called “Object Oriented Programming Language”.

How Java Diffent from Other Object Oriented Program Languages?

 Other languages like C++, would have the OOPs concepts. but they are plotform dependent.

Java is Plotform Independent language. Not understanding???

If you write a program in one plotform (windows), you can run the program on different plotform (Linux,Unix). It will run in different plotform.

only thing we need to do is set up the path, classpath settings.

How Java is Plotform Independent?

To answer this question, we need to know little bit about java program compilation.

Java have 2 step process for complie and run the application. that is 1) Compilation 2) Interpretation

Compilation: once you write the program, and compiles the program, it will creat a .class file (Byte Code).

Interpretation: After getting the .class file, the interpreter interprets the code (Checking line-by-line) and creates the executable file.

Once we get the byte code (.class file), we can take that code and run on any plotform, it will run the java program.

That’s why java compile once and run anywhere….so it is plotform independent.

How can we compile and Run a Java program?

To Compile a java program, we require JDK (Java Development ToolKit). Which contains both Java Compiler and JRE (Java run time Environment).

We need to install the JDK to write a java program and compile the program. we need to set up the path. (we will check in next chapter).

Is JDK also Plotform Independent?

 No, JDK is plotform Dependent. Because JRE is plotform dependent. the JRE is different for different plotforms.

Is it necessary to have JDK in every machine to run the Java Application/Program?

 No, It’s not necessary to have install JDK in every machine to run the application. if we have the Byte code of an application and want to run the program, we need to set up the path  and run the program.

JRE will come with Every Operating System. we need set the path to JRE to run the java program.


We will learn more about set up the path and the commands to  compile  and run a  java program.


See you guys…have a nice day…… 🙂 .




Posted in Chapter-II | Leave a Comment »