JavaTraining_January2025
JavaTraining_January2025
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 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.
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.
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.
JAVA PLATFORMs
1. Java Platform, Standard Edition (Java SE) JAVA or JAVA SE or J2SE are similar.
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.
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
-------------------------------------------
The Java EE platform provides an API and runtime environment for developing and running large-
scale, multi-tiered, scalable, reliable, and secure network applications.
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
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 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 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.
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:
Java SE 8 was released on March 18, 2014. Some of the major new features introduced in JAVA 8
are,
Lambda Expressions
Enhanced Security
Java SE 9 was released on September 2017. Some of the major new features introduced in JAVA 9
are,
Java SE 10 was released on March 2018. Some of the major new features introduced in JAVA 10
are,
Java SE 11 was released in September 2018. Some of the major new features introduced in JAVA
11 are,
Java SE 12 was released in March 2019. Some of the major new features introduced in JAVA 12
are,
Java SE 13 was released in September 2019. Some of the major new features introduced in JAVA
13 are,
Java SE 14 was released in March 2020. Some of the major new features introduced in JAVA 14
are,
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.
NOTE: USING JAVA, we can develop both standalone as well as web applications.
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.
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.
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.
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.
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.
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.
JDK architecture
JAVA Architecture
-------------------------
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.
JRE included
Java Compiler.
Source Code
Compiled
Java Program
JRE
Java Runtime Environment.
Components
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.
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.
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.
Class Test {
////Body of Test class;
}
Interface B {
////Interface Body
}
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.