Translate

Sunday 10 August 2014

Java: Let's Start

Java!!
What is java? Some programming language. Blah blah blah. :P
First we have to understand what is programming language? :O
Programming language is a formal language written by user to instruct a machine.
Java is an Object Oriented Programming language created by sun microsystems in 1995. Java is used to create applet and application programs.
Applets are java program that are embedded within a web page.
Application programs are programs that are written for a specific application and which can run on any machine supporting java.
In java first program is compiled then interpreted. For compilation of java code we need JVM (Java Virtual Machine). Java is platform independent but JVM is platform dependent.  JVM is combination of OS and Java interpreter. Here we are going to use Java on windows platform.

To run java into your system first you have to install JDK. You can find it online.
Please follow this link for installation or you can google it. Please set the environment variables too.

http://docs.oracle.com/javase/8/docs/technotes/guides/install/windows_jdk_install.html

Now to compile a java program open your command prompt.
c:>javac Demo.java
javac is the compiler that compiles our Demo.java program and creates a file with the extension .class.
class file contains byte code which are binary instruction for java interpreter.
To run application program after compilation enter
c:>java Demo
This will execute the file.  Always save the java file name with the name of class.





No comments:

Post a Comment

Total Pageviews