SlideShare a Scribd company logo
Unit 1 –
Introduction
to Java
Contents
 History and Evolution of Java
 Fundamentals of Object Oriented Programming – OOP’s Paradigm, basic
concepts, benefits and application.
 Java vs C vs C++
 Overview of Java- Simple program
 Platform independent nature of Java- JDK, Java interpreter, bytecode, JVM,
JRE.
 Features of Java
History and Evolution of Java
 Java was originally developed by James Gosling and his team at Sun
Microsystems. It was released in May 1991.
 This language was initially called “Oak” but was renamed “Java” in 1995.
 The primary motivation for was a need for a platform-independent
language.
 Initially, Sun microsystems released JDK 1.0 in 1997 and the following
versions were released in the later years.
 in 2010, Oracle acquired the ownership of Java.
 As of June 2024, Java 22 is the latest released Java version. In
September 2024, Java 23 will follow.
Fundamentals of Object Oriented
Programming.
 Object-oriented programming (OOP) is a programming paradigm based on the
concept of objects, which can contain data and code: data in the form of fields
(often known as attributes or properties), and code in the form of procedures
(often known as methods). In OOP, computer programs are designed by making
them out of objects that interact with one another.
 An Object has properties and behaviors. Properties are described by using data,
and behaviors are described by using method. Objects are defined by using
classes in Java.
 Java is Object-Oriented because java programming is centered on creating
objects, manipulating objects and making objects work together.
Unit 1 – Introduction to Java- (Shilpa R).pptx
Object Oriented Programming -
Paradigms
 Class: A blueprint or template for creating objects. It defines a type of
object and encapsulates data and methods that operate on that data.
Example: class Car { }
 Object: An instance of a class. It represents a concrete entity with state
and behavior.
Example: Car myCar = new Car();
// Define a class named Greeting
class Greeting {
// Method to print "Hello, World!"
void sayHello() {
System.out.println("Hello, World!");
}
}
// Main class
public class HelloWorld {
public static void main(String[] args) {
// Create an object of the Greeting class
Greeting greeting = new Greeting();
// Call the sayHello method on the Greeting object
greeting.sayHello();
}
}
 Abstraction in Java is the process in which we only show essential
details/functionality to the user. The non-essential implementation
details are not displayed to the user. The interface in Java is a mechanism
to achieve abstraction.
 Encapsulation in Java is a fundamental concept in object-oriented
programming (OOP) that refers to the bundling of data and methods
that operate on that data within a single unit, which is called a class in
Java.
 Inheritance allows one class (subclass or derived class) to inherit the
attributes and methods from another class (superclass or base class).
This promotes code reusability and establishes a natural hierarchy.
 Polymorphism allows us to perform a single action in different ways.
In other words, polymorphism allows you to define one interface and
have multiple implementations. The word “poly” means many and
“morphs” means forms, So it means many forms.
Benefits
 1. Code Reusability: Inheritance supports the reusability of code.
 2. Simple Troubleshooting: the data and the methods that operate on it
are kept together in the same class, allowing for easier organization
and debugging of the code.
 3. Prevents Data Redundancy: Using encapsulation, OOPs help reduce
data redundancy by allowing to reuse of data in multiple classes. This
means that without having to rewrite, the same data can be used in
multiple classes.
 4. Modularity: Modularity helps break down complex code into smaller,
more manageable chunks..
 5. Code Maintenance: OOPs provide tools such as inheritance,
abstraction, and encapsulation that make it easier to modify, maintain,
and debug code.
 6. Code Security: Data abstraction and encapsulation in Java provide
security advantages by allowing the user to restrict access to certain
data and methods.
 7. Problem-Solving Ability: Object-oriented programming (OOPS) is a
powerful approach to solving complex problems by breaking them
down into smaller, bite-sized components. It enables modules with the
same interface to replace smaller codes. This approach enables
efficient problem-solving and improved overall performance
OOP’s- Applications
1. Client-Server Systems
2. Object-Oriented Databases
3.Real-Time System Design
4.Office Automation Systems
5.CIM(Computer-Integrated Manufacturing)/CAD(Computer-Aided
Design)/CAM Systems(Computer-Aided Manufacturing)
Difference between C , C++ and Java
Feature Java C C++
Memory Management Automatic garbage collection Manual (malloc/free) Manual (new/delete, with RAII)
Platform Cross-platform (WORA- (JVM)) Platform-specific Platform-specific
Syntax Simpler, high-level Low-level, closer to hardware
Combines C-style with object-
oriented features
Paradigm Object-oriented Procedural Object-oriented and Procedural
Inheritance Supports single inheritance Not applicable Supports multiple inheritance
Standard Library
Rich, with built-in classes and
utilities
Minimal standard library
Rich, extends C library with STL
(Standard Template Library)
Compilation
Compiled to bytecode (runs on
JVM)
Compiled to native machine code Compiled to native machine code
Exception Handling Built-in (try/catch/finally) Not built-in Built-in (try/catch)
Java program structure
 Documentation Section
You can write a comment in this section.
 Package statement
You can create a package with any name. A package is a group of classes
that are defined by a name. It is declared as:
package package_name;
 Import statements
This line indicates that if you want to use a class of another package, then
you can do this by importing it directly into your program.
 Interface statement
Interfaces are like a class that includes a group of method declarations. It's an
optional section and can be used when programmers want to implement multiple
inheritances within a program.
 Class Definition
A Java program may contain several class definitions. Classes are the main and
essential elements of any Java program.
 Main Method Class
Every Java stand-alone program requires the main method as the starting point of
the program. This is an essential part of a Java program.
public
It is the visibility. This can be public, private, protected or (if you omit a value) default
static
It is a special [optional] keyword that indicates that this method can be called without
creating an instance of this class. Without it, you have to instantiate this class and call this
method from the resulting object.
void
It is the return type of this method, indicating that this method doesn't return anything.
Methods must have a return type.
main
It is the name of this method. Methods have to be named. The parentheses indicate that
this is a method.
String[] args
It is a single parameter for the method. String[] is the type of the parameter, indicating an
array of Strings. args is the name of the parameter. Parameters must be named.
SIMPLE PROGRAM OF JAVA
/**
*Hello World, first application, only output.
*/
public class hello
{
public static void main (String [] args)
{
System.out.println(“Hello Worldn”);
} //end main
}//end class
Unit 1 – Introduction to Java- (Shilpa R).pptx
JDK, JVM, Byte code
 Java Development Kit (JDK) is a software development environment
used for developing Java applications and applets. It includes the Java
Runtime Environment (JRE), an interpreter/loader (Java), a compiler
(javac), an archiver (jar), a documentation generator (Javadoc), and
other tools needed in Java development.
 JRE stands for “Java Runtime Environment” .The Java Runtime
Environment provides the minimum requirements for executing a Java
application; it consists of the Java Virtual Machine (JVM), core classes,
and supporting files.
 JVM (Java Virtual Machine) is a very important part of both JDK and
JRE because it is contained or inbuilt in both. Whatever Java program
you run using JRE or JDK goes into JVM and JVM is responsible for
executing the java program line by line, hence it is also known as an
interpreter.
 BYTE CODE
Bytecode is program code that has been compiled from source code into low-level
code designed for a software interpreter. It may be executed by a virtual machine
(such as a JVM) or further compiled into machine code, which is recognized by the
processor.
Features of Java
1) Simple
2) Object Oriented
3) Robust
4) Platform Independent – “WORA”
5) Secure
6) Multi Threading
7) Architectural Neutral
8) Portable
9) High Performance
THANK YOU

More Related Content

PPTX
object oriented programming unit one ppt
PPTX
1 Introduction to JAVA.pptx
PPTX
PPTX
oop unit1.pptx
PPTX
U1 JAVA.pptx
PDF
Java programming material for beginners by Nithin, VVCE, Mysuru
PDF
Basic Java Programming
PPTX
introduction to object orinted programming through java
object oriented programming unit one ppt
1 Introduction to JAVA.pptx
oop unit1.pptx
U1 JAVA.pptx
Java programming material for beginners by Nithin, VVCE, Mysuru
Basic Java Programming
introduction to object orinted programming through java

Similar to Unit 1 – Introduction to Java- (Shilpa R).pptx (20)

PDF
lecture-1111111111111111111111111111.pdf
DOCX
Java notes
PPTX
Java Programming - UNIT - 1, Basics OOPS, Differences
PPTX
PPT
Object oriented programming_Unit1_Introduction.ppt
PPTX
Core java &collections
PPTX
Core java1
PPTX
Core java
PDF
Java notes
PPTX
Corejava
PPTX
PPTX
Object oriented programming-with_java
PPTX
Object oriented programming
PPTX
Object oriented programming-with_java
PPTX
Object oriented programming
PPTX
Object oriented programming-with_java
PPTX
Object oriented programming
PPTX
Object oriented programming
PPTX
Journey-into-the-World-of-Java.pp3dqe23R3qtx
PPTX
lecture-1111111111111111111111111111.pdf
Java notes
Java Programming - UNIT - 1, Basics OOPS, Differences
Object oriented programming_Unit1_Introduction.ppt
Core java &collections
Core java1
Core java
Java notes
Corejava
Object oriented programming-with_java
Object oriented programming
Object oriented programming-with_java
Object oriented programming
Object oriented programming-with_java
Object oriented programming
Object oriented programming
Journey-into-the-World-of-Java.pp3dqe23R3qtx
Ad

More from shilpar780389 (6)

PPTX
BCA - Chapter Groups- presentation(ppt).pptx
PPTX
Internet_Technology_UNIT V- Introduction to XML.pptx
PPTX
Data Structures-UNIT Four_Linked_List.pptx
PPTX
UNIT 3- Java- Inheritance, Multithreading.pptx
PPTX
UNIT – 2 Features of java- (Shilpa R).pptx
PPTX
Unit 2- Control Structures in C programming.pptx
BCA - Chapter Groups- presentation(ppt).pptx
Internet_Technology_UNIT V- Introduction to XML.pptx
Data Structures-UNIT Four_Linked_List.pptx
UNIT 3- Java- Inheritance, Multithreading.pptx
UNIT – 2 Features of java- (Shilpa R).pptx
Unit 2- Control Structures in C programming.pptx
Ad

Recently uploaded (20)

PDF
Electronic commerce courselecture one. Pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Empathic Computing: Creating Shared Understanding
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
KodekX | Application Modernization Development
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Cloud computing and distributed systems.
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Machine learning based COVID-19 study performance prediction
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Electronic commerce courselecture one. Pdf
Spectral efficient network and resource selection model in 5G networks
Network Security Unit 5.pdf for BCA BBA.
Per capita expenditure prediction using model stacking based on satellite ima...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Empathic Computing: Creating Shared Understanding
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
KodekX | Application Modernization Development
MYSQL Presentation for SQL database connectivity
Cloud computing and distributed systems.
Big Data Technologies - Introduction.pptx
Understanding_Digital_Forensics_Presentation.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Machine learning based COVID-19 study performance prediction
Dropbox Q2 2025 Financial Results & Investor Presentation
Unlocking AI with Model Context Protocol (MCP)
Mobile App Security Testing_ A Comprehensive Guide.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...

Unit 1 – Introduction to Java- (Shilpa R).pptx

  • 2. Contents  History and Evolution of Java  Fundamentals of Object Oriented Programming – OOP’s Paradigm, basic concepts, benefits and application.  Java vs C vs C++  Overview of Java- Simple program  Platform independent nature of Java- JDK, Java interpreter, bytecode, JVM, JRE.  Features of Java
  • 3. History and Evolution of Java  Java was originally developed by James Gosling and his team at Sun Microsystems. It was released in May 1991.  This language was initially called “Oak” but was renamed “Java” in 1995.  The primary motivation for was a need for a platform-independent language.  Initially, Sun microsystems released JDK 1.0 in 1997 and the following versions were released in the later years.  in 2010, Oracle acquired the ownership of Java.  As of June 2024, Java 22 is the latest released Java version. In September 2024, Java 23 will follow.
  • 4. Fundamentals of Object Oriented Programming.  Object-oriented programming (OOP) is a programming paradigm based on the concept of objects, which can contain data and code: data in the form of fields (often known as attributes or properties), and code in the form of procedures (often known as methods). In OOP, computer programs are designed by making them out of objects that interact with one another.  An Object has properties and behaviors. Properties are described by using data, and behaviors are described by using method. Objects are defined by using classes in Java.  Java is Object-Oriented because java programming is centered on creating objects, manipulating objects and making objects work together.
  • 6. Object Oriented Programming - Paradigms  Class: A blueprint or template for creating objects. It defines a type of object and encapsulates data and methods that operate on that data. Example: class Car { }  Object: An instance of a class. It represents a concrete entity with state and behavior. Example: Car myCar = new Car();
  • 7. // Define a class named Greeting class Greeting { // Method to print "Hello, World!" void sayHello() { System.out.println("Hello, World!"); } } // Main class public class HelloWorld { public static void main(String[] args) { // Create an object of the Greeting class Greeting greeting = new Greeting(); // Call the sayHello method on the Greeting object greeting.sayHello(); } }
  • 8.  Abstraction in Java is the process in which we only show essential details/functionality to the user. The non-essential implementation details are not displayed to the user. The interface in Java is a mechanism to achieve abstraction.  Encapsulation in Java is a fundamental concept in object-oriented programming (OOP) that refers to the bundling of data and methods that operate on that data within a single unit, which is called a class in Java.
  • 9.  Inheritance allows one class (subclass or derived class) to inherit the attributes and methods from another class (superclass or base class). This promotes code reusability and establishes a natural hierarchy.  Polymorphism allows us to perform a single action in different ways. In other words, polymorphism allows you to define one interface and have multiple implementations. The word “poly” means many and “morphs” means forms, So it means many forms.
  • 10. Benefits  1. Code Reusability: Inheritance supports the reusability of code.  2. Simple Troubleshooting: the data and the methods that operate on it are kept together in the same class, allowing for easier organization and debugging of the code.  3. Prevents Data Redundancy: Using encapsulation, OOPs help reduce data redundancy by allowing to reuse of data in multiple classes. This means that without having to rewrite, the same data can be used in multiple classes.  4. Modularity: Modularity helps break down complex code into smaller, more manageable chunks..
  • 11.  5. Code Maintenance: OOPs provide tools such as inheritance, abstraction, and encapsulation that make it easier to modify, maintain, and debug code.  6. Code Security: Data abstraction and encapsulation in Java provide security advantages by allowing the user to restrict access to certain data and methods.  7. Problem-Solving Ability: Object-oriented programming (OOPS) is a powerful approach to solving complex problems by breaking them down into smaller, bite-sized components. It enables modules with the same interface to replace smaller codes. This approach enables efficient problem-solving and improved overall performance
  • 12. OOP’s- Applications 1. Client-Server Systems 2. Object-Oriented Databases 3.Real-Time System Design 4.Office Automation Systems 5.CIM(Computer-Integrated Manufacturing)/CAD(Computer-Aided Design)/CAM Systems(Computer-Aided Manufacturing)
  • 13. Difference between C , C++ and Java
  • 14. Feature Java C C++ Memory Management Automatic garbage collection Manual (malloc/free) Manual (new/delete, with RAII) Platform Cross-platform (WORA- (JVM)) Platform-specific Platform-specific Syntax Simpler, high-level Low-level, closer to hardware Combines C-style with object- oriented features Paradigm Object-oriented Procedural Object-oriented and Procedural Inheritance Supports single inheritance Not applicable Supports multiple inheritance Standard Library Rich, with built-in classes and utilities Minimal standard library Rich, extends C library with STL (Standard Template Library) Compilation Compiled to bytecode (runs on JVM) Compiled to native machine code Compiled to native machine code Exception Handling Built-in (try/catch/finally) Not built-in Built-in (try/catch)
  • 16.  Documentation Section You can write a comment in this section.  Package statement You can create a package with any name. A package is a group of classes that are defined by a name. It is declared as: package package_name;  Import statements This line indicates that if you want to use a class of another package, then you can do this by importing it directly into your program.
  • 17.  Interface statement Interfaces are like a class that includes a group of method declarations. It's an optional section and can be used when programmers want to implement multiple inheritances within a program.  Class Definition A Java program may contain several class definitions. Classes are the main and essential elements of any Java program.  Main Method Class Every Java stand-alone program requires the main method as the starting point of the program. This is an essential part of a Java program.
  • 18. public It is the visibility. This can be public, private, protected or (if you omit a value) default static It is a special [optional] keyword that indicates that this method can be called without creating an instance of this class. Without it, you have to instantiate this class and call this method from the resulting object. void It is the return type of this method, indicating that this method doesn't return anything. Methods must have a return type. main It is the name of this method. Methods have to be named. The parentheses indicate that this is a method. String[] args It is a single parameter for the method. String[] is the type of the parameter, indicating an array of Strings. args is the name of the parameter. Parameters must be named.
  • 19. SIMPLE PROGRAM OF JAVA /** *Hello World, first application, only output. */ public class hello { public static void main (String [] args) { System.out.println(“Hello Worldn”); } //end main }//end class
  • 21. JDK, JVM, Byte code  Java Development Kit (JDK) is a software development environment used for developing Java applications and applets. It includes the Java Runtime Environment (JRE), an interpreter/loader (Java), a compiler (javac), an archiver (jar), a documentation generator (Javadoc), and other tools needed in Java development.  JRE stands for “Java Runtime Environment” .The Java Runtime Environment provides the minimum requirements for executing a Java application; it consists of the Java Virtual Machine (JVM), core classes, and supporting files.  JVM (Java Virtual Machine) is a very important part of both JDK and JRE because it is contained or inbuilt in both. Whatever Java program you run using JRE or JDK goes into JVM and JVM is responsible for executing the java program line by line, hence it is also known as an interpreter.
  • 22.  BYTE CODE Bytecode is program code that has been compiled from source code into low-level code designed for a software interpreter. It may be executed by a virtual machine (such as a JVM) or further compiled into machine code, which is recognized by the processor.
  • 23. Features of Java 1) Simple 2) Object Oriented 3) Robust 4) Platform Independent – “WORA” 5) Secure 6) Multi Threading 7) Architectural Neutral 8) Portable 9) High Performance