Java is a computer programming language. It enables programmers to write computer instructions using English-based commands instead of having to write in numeric codes. It’s known as a high-level language because it can be read and written easily by humans. Like English, Java has a set of rules that determine how the instructions are written. These rules are known as its syntax. Once a program has been written, the high-level instructions are translated into numeric codes that computers can understand and execute.
Evolution of JAVA?
In the early nineties, Java was created by a team led by James Gosling for Sun Microsystems. It was originally designed for use on digital mobile devices, such as cellphones. However, when Java 1.0 was released to the public in 1996, its main focus had shifted to use on the internet. It provided interactivity with users by giving developers a way to produce animated webpages. Over the years, it evolved as a successful language for use both on and off the internet.
There are many features and Principles of java :-
Ease of Use: The fundamentals of Java came from a programming language called C++. Although C++ is a powerful language, it is complex in its syntax and inadequate for some of Java's requirements. Java built on and improved the ideas of C++ to provide a programming language that was powerful and simple to use.
Reliability: Java needed to reduce the likelihood of fatal errors from programmer mistakes. With this in mind, object-oriented programming was introduced. When data and its manipulation were packaged together in one place, Java’s was robust.
Security: As Java was originally targeting mobile devices that would be exchanging data over networks, it was built to include a high level of security. Java is probably the most secure programming language to date.
Platform Independence: Programs need to work regardless of the machines it is being executed on. Java was written to be a portable language that doesn't care about the operating system or the hardware of the computer or device it is running on.
Note:-"Java is a programming language as well as a Platform"
Versions of java:-
What is JVM(Java Virtual Machine) :-
JVM (Java Virtual Machine) is an abstract machine. It is a specification that provides runtime environment in which java bytecode can be executed.
JVMs are available for many hardware and software platforms (i.e. JVM is platform dependent).
What it does:-
The JVM performs following operation:
Provides runtime environment
JVM provides definitions for the:
Class file format
Fatal error reporting etc.
Difference b/w jdk and jre :-
JDK is a superset of JRE, and contains everything that is in JRE, plus tools such as the compilers and debuggers necessary for developing applets and applications.
JRE provides the libraries, the Java Virtual Machine (JVM), and other components to run applets and applications written in the Java programming language.
Download Java :-
Yes, Java is free to download.The official website provides links to freely download the latest version of Java. You can use the Oracle Java website to learn more about downloading Java, verify Java is installed on your computer, remove older versions, troubleshoot Java or or report an issue. After installing Java, you will need to restart your Web browser.
How to install java in our machine :-
1. Go to Download java. Click on Download JDK. For java latest version.
Accept License Agreement
Download latest java JDK for your version(32 or 64 bit) of java for Windows
3. Once the download is complete, run the exe for install jdk . Click Next
4. Once install is complete click Close
5. Set Environment Variable, " PATH = \bin;%PATH%"
For Java 1.8
PATH = C:\Program Files\Java\jdk1.8.0_31\bin;%PATH%
6. Set Environment Variable, "CLASSPATH = \lib\tools.jar;"
For Java 1.8
CLASSPATH = C:\Program Files\Java\jdk1.8.0_31\lib\tools.jar;
7. Restart your PC. Go to command prompt and type javac
If you see a screen like below' Java is installed.
Example of Hello World program :-