Before learning JAVA, it is advisable that you should have a programming background. Even if you re not from programming background, I will try to make it as simple as I can.
It is a programming language, which is based on the concepts of C++ ( inheritance,OOPs etc. ). It works on the motto
“Write Once, Run Anywhere”.
How does JAVA works?
- Create a source file in this language and save it with .java extension.
- Path of the source file is given to the JAVA compiler( javac ), the work of this compiler is to check for the errors, exception handling etc and then converting the .java file into a Byte-code, this byte-code is stored in a file with the extension .class . Byte-code is platform independent.
- Now, we just require a JVM( Java Virtual Machine ), which will take byte code( .class file ) and then execute it.
How JAVA changed the Internet?
- Applets: A JAVA applet is a small program which is embedded in a web-page. Whenever a web-page ( embedded with applet ) is loaded at that point, Byte-Code is transferred and it is executed by the JVM( Java Virtual Machine ).
- Security: Whenever the JAVA code/software is distributed, it is always downloaded in the form of byte code, rather than the code itself. It is one of the major differences from C++, in which the source code is always distributed and anyone can make changes, implement it in his own way etc.
- Portability: It works on the principle of “Write Once, Run Anywhere”. JAVA( language ) is platform independent, whereas the JVM( executes byte-code ) is platform dependent.
Features of JAVA:
- Purely object oriented
- Better look and feel than C/C++
Various Terms :
- JDK: Java Development Kit( JDK ) is consists of Java compiler, JVM and JRE.
- JRE: Java Run-time Environment( JRE ) consists of the JVM, along with libraries and supporting files(appletviewer etc.) as well. JRE is a part of JDK.
- JVM: Java Virtual Machine( JVM ) is a virtual machine which executes byte-code. It is provided along with JRE.
- Environment variables: Environment variables is a dynamic “object” on a computer, which stores a particular value, and this value is referred frequently by certain programs on the system.
- JDK 7 Download it From Here
- Notepad/Notepad++(or any text editor)
- Do NOT use IDE, as it may protect you from some of the details which really matter.
- After installing JDK, we have to set an Environment Variable named “path”
Setting the Environment variable ( in Windows 7 and 8)
- Right Click on My Computer and select Properties.
- Select Advanced System Settings, then go to Advanced Tab.
- Click on Environment Variables, then click on New.
- Variable name: path
- Variable value: give the path directory till bin folder, in most cases the value will be C:Program FilesJavajdk1.7.0_45bin
NOTE: Those who are using Linux or Windows XP, use Google for setting up the environment variables.