0% found this document useful (0 votes)
7 views

JavaTraining_January2025

Java is a widely used, high-level, object-oriented programming language known for its platform independence and robust features. Developed in 1991 by James Gosling and others at Sun Microsystems, Java has evolved through various versions, introducing significant enhancements for application development across desktop, web, and mobile platforms. Its applications range from enterprise solutions to embedded systems, making it a versatile choice for developers worldwide.

Uploaded by

ravi.yoof
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

JavaTraining_January2025

Java is a widely used, high-level, object-oriented programming language known for its platform independence and robust features. Developed in 1991 by James Gosling and others at Sun Microsystems, Java has evolved through various versions, introducing significant enhancements for application development across desktop, web, and mobile platforms. Its applications range from enterprise solutions to embedded systems, making it a versatile choice for developers worldwide.

Uploaded by

ravi.yoof
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 17

INTRODUCTION TO JAVA

Java is one of the world's most important and widely used computer languages, and it has held this
distinction for many years.

Java has grown, unlike some other computer languages whose influence has weared with time.

Java is a high-level, robust, object-oriented, secure, and stable programming language

Java is not a pure object-oriented language because it supports primitive data types like int, char,
etc, Java does not support multiple inheritance.

Java is a platform-independent language because Java byte code can be run on any OS or machine
with JDK installed.

Here platform means a hardware or software environment in which an application runs.

Java codes are compiled into byte code or machine-independent code.

This byte code is run on JVM (Java Virtual Machine).

The syntax of Java is almost the same as C/C++.

But Java does not support low-level programming functions like pointers.

The codes in Java are always written in the form of Classes and objects.

As of 2020, Java is one of the most popular programming languages in use, especially for client-
server web applications.

It has been estimated that there are around nine million Java developers in the world.

Creation of Java
---------------------------------------

Java was developed by James Gosling, Patrick Naughton, and Mike Sheridan at Sun Microsystems
Inc. in 1991.

It took 18 months to develop the first working version.

The initial name was Oak but it was renamed to Java in 1995 as OAK was a registered trademark of
another Tech company.

History of Java
----------------

Originally Java was designed for Interactive television, but this technology was very much
advanced for the industry of digital cable television at that time.
Java history was started with the Green Team. The Green Team started a project to develop a
language for digital devices such as television.
But it works best for internet programming. After some time Java technology was joined by
Netscape.

The objective to create Java Programming Language was it should be "Simple, Robust, Portable,
Platform-independent, Secured, High Performance, Multithreaded, Object-Oriented, Interpreted,
and Dynamic".

Java was developed in Sun Microsystem by James Ghosling, Patrick Naughton, Mike Sheridan in
1991.
It took 18 months to develop the first working version.
James Ghosling is also known as the Father of Java.

Initially, Java was called "Greentalk" by James Gosling and at that time the file extension was .gt.

Later on Oak was developed as a part of the Green Team project. Oak is a symbol for strength and
Oak is also a national tree in many countries like the USA, Romania etc.

Oak was renamed as Java in 1995 because Oak was already a trademark by Oak Technologies.
Before selecting the Java word the team suggested many names like dynamic, revolutionary, Silk,
jolt, DNA, etc.

Java is an island in Indonesia, here the first coffee was produced or we call it Java coffee. Java
coffee is a type of espresso bean. James Gosling chose this name while having coffee near his
office.

The word JAVA does not have an acronym. It is just a name.

In 1995 Java was one of the best products by Time magazine.

JAVA PLATFORMs

There are four platforms of the Java programming language:

1. Java Platform, Standard Edition (Java SE) JAVA or JAVA SE or J2SE are similar.

2. Java Platform, Enterprise Edition (Java EE)

3. Java Platform, Micro Edition (Java ME)

4. JavaFX
It's clear that all Java platforms consist of a Java Virtual Machine (VM) and an application
programming interface (API).

The Java Virtual Machine is a program, for a particular hardware and software platform, that runs
Java technology applications.

You can read more about JVM, JRE, and JDK at Java JVM, JRE and JDK Explained with Diagrams.

1. Java SE (Standard Edition)


----------

Java Platform, Standard Edition (Java SE) consists of APIs that provide the core functionality of the
Java programming language.

It defines everything from the basic types and objects of the Java programming language to high-
level classes that are used for networking, security, database access, graphical user interface (GUI)
development, and XML parsing.

In addition to the core API, the Java SE platform consists of a virtual machine, development tools,
deployment technologies, and other class libraries and toolkits commonly used in Java technology
applications.

A Java Developer is responsible for designing, implementing, and maintaining Java-based software
and applications

-------------------------------------------

2. Java EE (Enterprise Edition)


---------

The Java EE platform is built on top of the Java SE platform.

The Java EE platform provides an API and runtime environment for developing and running large-
scale, multi-tiered, scalable, reliable, and secure network applications.

Ex: Bank, large scale company

Java EE simplifies enterprise applications by defining and specifying a complete set of common
standard services, such as naming, transaction management, concurrency, security, and database
access

3. Java ME (Micro Edition)


-----------

The Java ME platform provides an API and a small-footprint virtual machine for running Java
programming language applications on small devices, like mobile phones.

The API is a subset of the Java SE API, along with special class libraries useful for small device
application development.

Java ME applications are often clients of Java EE platform services.

Java Platform, Micro Edition (Java ME) provides a robust, flexible environment for applications
running on embedded and mobile devices in the Internet of Things: micro-controllers, sensors,
gateways, mobile phones, personal digital assistants (PDAs), TV set-top boxes, printers and more.

4. JavaFX
----------

JavaFX is a platform for creating rich internet applications using a lightweight user-interface API.

JavaFX applications use hardware-accelerated graphics and media engines to take advantage of
higher-performance clients and a modern look-and-feel as well as high-level APIs for connecting to
networked data sources.

JavaFX applications may be clients of Java EE platform services.

JavaFX is a software platform for creating and delivering desktop applications, as well as rich web
applications that can run across a wide variety of devices. JavaFX has support for desktop computers
and web browsers [citation needed] on Microsoft Windows, Linux (including Raspberry Pi), and
macOS, as well as mobile devices running iOS and Android, through Gluon Mobil

Java Source Code ---------------> Java Byte Code---------> JVM (Interpreter JIT) Machine
Code(Binary Code)
English language.java .Class File .Object
Platform Independent Platform Dependent.
JAVA Versions.
Version Name Code Name Release Date Description

Java Alpha and 1995 It was the 1st version but had unstable APIs
Beta and ABIs.

JDK 1.0 Oak January 1996 1st stable version.


JDK 1.1 February 1997 AWT Event modeling retooling.

Added Inner class, Java Beans, JDBC, RMI,


Reflection, JIT

J2SE 1.2 Playground December 1998 JDK was replaced by J2SE.


Support strictfp keyword.
Swing API integrated with core classes.
Collection framework.

J2SE 1.3 Kestrel May 2000 HotSpot JVM included


RMI Modified.
JNDI (Java Naming and Directory Interface).
Supported

JPDA (Java Platform Debugger


Architecture).
Included Proxy Classes.

J2SE 1.4 Merin February 2002 Support assert Keyword.


Improvement in libraries.
Support Regular expression.
Support Exception Chaining.
Support Java Web Start.
Support API Preferences (java.util.prefs).

J2SE 5.0 Tiger Varargs. September 2004 Included Generics, Metadata,


Autoboxing/Unboxing,
Enhanced for each loop.
Support static imports.
Java SE 6 Mustang December 2006.
Support Win9x version.
Support Scripting language.
Improved Swing performance.
Support JDBC 4.0
Upgrade of JAXB to 2.0
Improvement in GUI and JVM.

Java SE 7 Dolphin July 2011 Support of dynamic language in JVM.


Included 64-bit pointers.
Support string in the switch.
Support resource management in the try
block.
Support binary integer literals.
Support underscore in numeric literals.
Support multiple exceptions.
Included I/O library.
Java SE 8 LTS March 2014 Support of JSR 335 and JEP 126.
Support unsigned integer.
Support Date and Time API.
Included JavaFX.
Support Windows XP.

Java SE 9 September 2017 Support multiple gigabytes heaps.


Included garbage collector.

Java SE 10 March 2018 Support local variables type inference.


Support local variables type inference.
Included Application class.

Java SE 11 LTS September 2018 Support bug fixes.


Include long-term support (LTS).
Support transport layer security.

Java SE 12 March 2019 Support JVM Constant API.


Include CDS Archives.

Java SE 13 September 2019 Updated Switch Expressions.


Include Text Blocks.
Support Legacy socket API.

Java SE 14 March 2020 Support Event Streaming.


Improved NullPointerException.
Removal of the Concurrent Mark Sweep
(CMS) in the garbage collector.

Java SE 15 September 2020


Java SE 16 March 2021

Java SE 17 LTS September 2021 Evolution of Java.

Java se 18
Java 19
Java 20
Java 21 September 2023

Java was initially launched as Java 1.0 but soon after its initial release

--------------------------------------------
Java 1.1 was launched. Java 1.1 redefined event handling, and new library elements were added.

--------------------------------------------

In Java 1.2 Swing and Collection framework was added and suspend(), resume(), and stop() methods
were deprecated from the Thread class.

--------------------------------------------

No major changes were made to Java 1.3 but the next release that was Java 1.4 contained several
important changes. Keyword assert, chained exceptions, and channel-based I/O Systems were
introduced.

Java 1.5 was called J2SE 5, it added the following major new features:

 Generics
 Annotations
 Autoboxing and autounboxing
 Enumerations
 For-each Loop
 Varargs
 Static Import
 Formatted I/O
 Concurrency utilities

Next major release was Java SE 7 which included many new changes, like:

 Now String can be used to control Switch statement.


 Multi Catch Exception
 try-with-resource statement
 Binary Integer Literals
 Underscore in numeric literals, etc.

Java SE 8 was released on March 18, 2014. Some of the major new features introduced in JAVA 8
are,

Lambda Expressions

New Collection Package java.util.stream to provide Stream API.

Enhanced Security

Nashorn Javascript Engine included

Parallel Array Sorting

The JDBC-ODBC Bridge has been removed etc.

Java SE 9 was released on September 2017. Some of the major new features introduced in JAVA 9
are,

 Platform Module System (Project Jigsaw)


 Interface Private Methods
 Try-With Resources
 Anonymous Classes
 @SafeVarargs Annotation
 Collection Factory Methods
 Process API Improvement

Java SE 10 was released on March 2018. Some of the major new features introduced in JAVA 10
are,

 Support local variables type inference.


 Support local variables type inference.
 Included Application class.

Java SE 11 was released in September 2018. Some of the major new features introduced in JAVA
11 are,

 Support bug fixes.


 Include long-term support(LTS).
 Support transport layer security.

Java SE 12 was released in March 2019. Some of the major new features introduced in JAVA 12
are,

 Support JVM Constant API.


 Include CDS Archives.

Java SE 13 was released in September 2019. Some of the major new features introduced in JAVA
13 are,

 Updated Switch Expressions.


 Include Text Blocks.
 Support Legacy socket API.

Java SE 14 was released in March 2020. Some of the major new features introduced in JAVA 14
are,

 Support Event Streaming.


 Improved NullPointerException.
 Removal of the Concurrent Mark Sweep (CMS) in the garbage collector.

Application of Java
Java is widely used in every corner of the world and human life. Java is not only used in software but
is also widely used in designing hardware-controlling software components.

There are more than 930 million JRE downloads each year and 3 billion mobile phones run Java.

Following are some other uses of Java:

 Developing Desktop Applications.


 Web Applications like Linkedin.com, Snapdeal.com, etc.
 Mobile Operating System like Android.
 Embedded Systems.
 Robotics and games etc.
 Application Servers.
 Application for Enterprises.
 Scientific Applications.
 Business Applications.
 Big Data Technologies.

NOTE: USING C and C++ we can develop only standalone applications.

NOTE: USING JAVA, we can develop both standalone as well as web applications.

Types of Java Applications


-------------------------
Following are different types of applications that we can develop using Java:

1. Standalone Applications
--------
Standalone applications are application that runs on separate computer processes without adding
any file processes. The standalone application is also known as Java GUI Applications or Desktop
Applications which uses some standard GUI components such as AWT(Abstract Windowing
Toolkit), swing, and JavaFX, and these components are deployed to the desktop.

The application we are installing on our computer is called a standalone application.


An application that is always dependent on an operating system is called a standalone
application.

These components have buttons, menus, tables, GUI widget toolkit, 3D graphics, etc. Using this
component traditional software is developed which can be installed in every machine.

Standalone applications are self-contained and operate independently, often without an internet
connection or a server.

Standalone applications are:

 Independent.
 Installation: required
 No Externa Dependencies
 Data Storage: Locally
 Updates and Maintenance: Required and done by the user manually.
 Platform-Specific: Yes, platform dependent.

Examples: Media players, antivirus, Paint, POS Billing software, Mozilla Firefox, or Google Chrome
applications for the internet are examples of standalone applications.

2. Web Applications
----------
Web Applications are the client-server software application which is run by the client. Servlets,
struts, JSP, Spring, hibernate, etc. are used for the development of a client-server application.
Web applications are software programs that run on web servers and are accessed through
internet browsers using a network, such as the Internet.
Web applications run within a web browser environment and do not require any installation on
the user’s local device.

Web Applications are:

Accessibility: Can be accessed from any device with a web browser and internet connection.
Server-Client Model: It follows the client-server model.
No Installation Required: No need to install this kind of software.
Cross-Platform Compatibility: Web applications are platform-independent.
Data Storage: Web applications store their data on remote servers, which can be accessed from
anywhere using the internet.
Updates and Maintenance: Updates are automatically handled at the server where it has stored
so users do not need to take care of updates by themselves.
Technologies Involved: HTML, CSS, JAVASCRIPT.
Examples: Facebook.com, YouTube.com, gmail.com, google.com, yahoo.com.

3. Enterprise Application
-----------
Enterprise applications are those applications that companies use to facilitate complex business
processes.
Examples: e-commerce, accounting, banking information systems, etc.

Applications of enterprise applications:

Enterprise management systems support several business processes such as finance and
accounting, human resources, product and manufacturing, sales and marketing, etc.

Customer relationship management systems are divided into some customer analytical apps that
gather the data on your customer service app that interacts with the clients.

Supply chain management systems help the business plan goods delivery, analyze product
demand and track the goods.

 Speed and performance of the app development.


 Takes care of the Security.
 Java develops cost-saving applications.

4. Mobile Application
------------
For mobile applications, Java uses the ME or J2ME framework. This framework is a cross-platform
that runs applications across phones and smartphones. Java provides a platform for mobile
application development.
Mobile applications or OS like Android and iOS software for Android mobile and iPhone.

The main reason behind using java for mobile applications is that java for mobile app
development range from cross-platform compatibility, constant updates, and open-source to
community support and native mobile development tools.

Java mobile application benefits

 Security and robustness


 Widespread popularity
 Built-in mobile development features
 Relatively low investment
 Community Support: Use public libraries, and make the most of community support when
developing our mobile application.

JDK architecture
JAVA Architecture
-------------------------

NOTE: Learn here Java Architecture basic only.

Later on, we will learn in deep about JAVA architecture after finishing core Java.
JDK: JDK stands for Java development kit. JDK is a software for Java developers. It includes the Java
interpreter, Java classes, and Java development tools: Compiler, debugger, disassembler, applet
viewer, stub file generator, and documentation generator.

Jdk enables us to write applications that are developed once and run anywhere on any Java virtual
machine. Java applications that are developed with the JDK on one system can be used on another
system without changing or recompiling the code. The Java class files are portable to any standard
Java virtual machine.

Java Development Kit, or JDK, is a software development kit often called a superset of JRE and JVM.

JDK provides a platform to build complete Java applications and Java applet development.

JDK is platform-specific, so separate installers are needed for each operating system (e.g. Mac, Unix,
and Windows).

JDK contains all the tools required to compile, debug, and run a program developed using the Java
platform.

JDK components

JDK includes all the Java tools, executables, and binaries needed to run Java programs.

This includes JRE, a compiler, a debugger, an archive, and other tools that are used in Java
development.

Java Development Kit

JRE included

Java Compiler.

Source Code

Compiled

Java Program

JRE
Java Runtime Environment.

Components

Java libraries (prewritten)

Java class loader (load into JVM)

Java Virtual Machine (JVM)

JVM
Java Virtual Machine. It is part of JDK, jre-jvm.

Java Virtual Machine, or JVM, loads, verifies and executes Java bytecode.
It is known as the interpreter or the core Java programming language because it executes Java
programming.

JVM is specially responsible for converting bytecode to machine-specific code and is necessary in
both JDK and JRE.

It is also platform-dependent and performs many functions, including memory management and
security.

JVM can run programs written in another programming language that have been translated to Java
bytecode.

Java Native Interface (JNI) is often referred to in connection with JVM. JNI is a programming
framework that enables Java code running in JVM to communicate with (i.e. to call and be called by)
applications associated with a piece of hardware and specific operating system platform. These
applications are called native applications and can often be written in other languages.

DIFFERENCE BETWEEN JDK vs JRE vs JVM

1. JDK is for development purposes whereas JRE is for running Java programs.
2. JDK and JRE both contain JVM so that we can run our java program.
3. JVM is the heart of java programming language and provides platform independence.

JAVA PROGRAM FORMAT


Package Section It must be the first line of a Java program or can
be omitted if the class is to be kept only in the
default package. The package statement
defines a namespace in which classes are
stored, based on functionality. If omitted, the
classes are put into the default package, which
has no name.

Import Section Specifies the location to use a class or package


in a program.

Class Interface section A Java program may contain several classes or


interfaces.

Class with the Main method Every Java stand–alone program requires the
main method as the starting point of the
program. This is an
An essential part of a Java program. There may
be many classes in a Java program code file,
and only one class defines the main method.

Example Based On Program Format

///1. Package Section


Package com.chandan.Basic_Program;

///2. Import Section


Import java.util.Scanner; ////This line will import only one class from the util package.

///3. Class / Interface Section

Class Test {
////Body of Test class;
}
Interface B {
////Interface Body
}

///4. Main Method Section

Public class Demo_Test {


Public static void main(String[] args) {
////body of main method
}
}

Ex.
Public class DemoTest {
Public static void main(String[] args) {
System.out.println(“Welcome to java Programming”);
}
}
OUTPUT
Welcome to java Programming
ASSIGNMENTs
1. WHAT IS THE DIFFERENCE BETWEEN JDK, JRE, AND JVM?
2. Is JDK, JVM, and JRE platform independent? Or dependent? Give a reason for it.
3. Why java is platform platform-independent language? What do you mean by platform-
dependent and independent?
4. What are JAVA platform available? Explain them.
5. What is a platform in the Software industry?
6. Why java is called a programming language?
7. Why java is called a simple, portable, and high-level language?
8. What is the format of the Java program? Explain the format using a Java program.
9. Why different versions of Java is Coming again and again in the IT industry? Give a reason for it
with an example.
10. Why java is called an object-oriented programming language? Is Java 100% object-oriented
programming language or not? Give a reason also.
11. What is the command to run a Java source file from the command prompt?
12. Is the main() method compulsory for every Java project? Give a reason also.
13. What are the applications of Java?
1. What is application? Explain different types of Applications.
15. Explain JDK architecture.

You might also like