Introduction to Core Java

0 Comments

 

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:-

  • JDK 1.0 (January 23, 1996)

  • JDK 1.1 (February 19, 1997)

  • J2SE 1.2 (December 8, 1998)

  • J2SE 1.3 (May 8, 2000)

  • J2SE 1.4 (February 6, 2002)

  • J2SE 5.0 (September 30, 2004)

  • Java SE 6 (December 11, 2006)

  • Java SE 7 (July 28, 2011)

  • Java SE 8 (March 18, 2014)

  • Java SE 9 (September 21,2017)

 

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:

  • Loads code

  • Verifies code

  • Executes code

  • Provides runtime environment

JVM provides definitions for the:

  • Memory area

  • Class file format

  • Register set

  • Garbage-collected heap

  • 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.

2.

  1. Accept License Agreement

  2. Download latest java JDK for your version(32 or 64 bit) of java for Windows

How to install Java JDK 8 and Java 8 download

3. Once the download is complete, run the exe for install jdk . Click Next

How to install Java JDK 8 and Java 8 download

4. Once install is complete click Close

How to install Java JDK 8 and Java 8 download

5. Set Environment Variable, " PATH = \bin;%PATH%"

For Java 1.8

PATH = C:\Program Files\Java\jdk1.8.0_31\bin;%PATH%

How to install Java JDK 8 and Java 8 download

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 :-

 

 

 

Comments

WRITE A COMMENT