Running Java Program

Java is developed in 1991. It is Architecture Independent. It is a language basically designed to work in consumer electronics.

Earlier languages like BASIC, COBOL, FORTRON, ADA etc. were not suitable for system programming because it was more structured and procedural in nature.

The first programmer’s language called ‘C’ was developed by Dennis Richie and ended up being too complex.
C++ was developed by Bjarne Stroucstrup and was called as “C with classes” initially.

The four pillars of OOPS(Object Oriented Programming Skills) are :

1. Polymorphism
2. Inheritance
3. Data Abstraction(Hiding the implementation)
4. Encapsulation

In procedural programming focus is on procedures where as in object oriented programming emphasis is given to data.

What we need to create and execute JAVA files :

1) JDK - lib (Libraries)
bin (All EXE Files)
JRE (Java Runtime Environment)
2) Note Pad Plus
3) Integrated Development Environment – Edit Plus

Run – Command – For Windows 95, Windows 98
cmd Windows 2000 and above

Set path at DOS prompt before you compile a file. - set path=c:\jdk1.4\bin
To compile a java file - javac
To execute / interpret a java file - java

class Hello
public static void main(String [] args)
{
System.out.println(“Hello”);
}

javac Hello.java
java Hello

System.out.println(“Hello”);
In System class, we have 3 members (also known as Fields)
1) In - InputStream
2) Out - PrintStream
3) Err - PrintStream Err

println is in System class in Out field which is pointing to PrintStream.