Pages

Monday, 25 April 2022

Introduction to Java

Java programming language is a high-level, object-oriented, general-purpose and secure programming language. It was developed by James Gosling at Sun Microsystems in 1991. At that time, they called it "OAK" later they changed the name to Java in 1995. 

Java is the most widely used programming language. Java is freely accessible to users, and we can run it on all the platforms. Java follows the WORA (Write Once, Run Anywhere) principle, and it is platform-independent.

Java is the name of an island in Indonesia where the first coffee(named java coffee) was produced. And this name was chosen by James Gosling while having coffee near his office. Note that Java is just a name, not an acronym.

Editions of Java or Parts of Java:

There are three editions of Java. Each Java edition has different capabilities. The editions of Java are:

1. Java Standard Editions (SE): We use this edition to create programs for a desktop computer.

2. Java Enterprise Edition (EE): We use this edition to create large programs that run on the server and to manage heavy traffic and complex transactions.

3. Java Micro Edition (ME): We use this edition to develop applications for small devices such as set-top boxes, phones, and appliances, etc.

Java Environment- JVM, JRE, and JDK


1. JDK (Java Development Kit)
Java Development Kit provides an environment that helps to develop and execute the Java program. 

JDK, along with the JRE, contains other resources like the interpreter, loader. compiler, an archiver (jar), and a documentation generator (Javadoc). These components together help you to build Java programs.

2. JRE (Java Runtime Environment)
JRE is a collection of tools. These tools together allow the development of applications and provide a runtime environment. JVM is a part of JRE.

3. JVM (Java Virtual Machine)
Java Virtual Machine provides a runtime environment in which we can execute the bytecode. It performs the following tasks:

Loading the code
Verifying the code
Executing the code
Providing a runtime environment

JDK = JRE + Development Tools ( Compilers, Debuggers)
  
JDK = (JVM + Libraries) + Development Tools ( Compilers, Debuggers)

JDK = Java Developer Kit - The JDK is what you need to compile JAVA source code

JRE = Java Runtime Environment -  is what you need to run a JAVA Program and contains a JVM, among other things such as Libraries.

JVM = Java Virtual Machine -  The JVM actual run java byte code





For Example:


Difference between C,C++,JAVA:

C:
C is a general-purpose, structured, procedural, and high-level programming language developed by Dennis MacAlistair Ritchie in 1972 at Bell Laboratories. The successor of the C language was CPL (Combined Programming Language). It is mainly used for system programming such as to develop the operating system, drivers, compilers, etc.

The best-known example of the operating system that was developed using C language is Unix and Linux.

Features of C Language
  • Machine independent and portable
  • Modern Control Flow and Structure
  • Rich set of operators
  • Simple, Fast, and efficient
  • Case-sensitive
  • Low memory use
  • Easily extendable
  • Statically-typed
C++ (C WITH CLASS):
C++ is an object-oriented, general-purpose, programming language developed by Bjarne Stroustrup at Bell Labs in 1979. It is based on C language or we can say that it is an extension of C language. It is used to develop high-performance applications.

Features of C++ Language:
  • Case-sensitive
  • Compiler based
  • Platform-independent
  • Portability
  • Dynamic memory allocation
Java
Java is also an object-oriented, class-based, static, strong, robust, safe, and high-level programming language. It was developed by James Gosling in 1995. It is bot compiled and interpreted. It is used to develop enterprise, mobile, and web-based applications.

Features of Java
  • Object-oriented
  • Architecture-neutral
  • Platform independent
  • Dynamic and Distributed
  • Robust
  • Secure
  • Multithreaded
The following figure demonstrates that C++ is based on the C language and Java is based on the C++ and C language.


No comments:

Post a Comment

Servlet - JSP Programs

JSP(Java Server Pages) Programs : JavaServer Pages (JSP) is a Java standard technology that enables you to write dynamic data-driven pages f...