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
Ad

More Related Content

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

01slide (1)ffgfefge
01slide (1)ffgfefge01slide (1)ffgfefge
01slide (1)ffgfefge
bsnl007
 
Java intro
Java introJava intro
Java intro
husnara mohammad
 
Classes and Objects
Classes and ObjectsClasses and Objects
Classes and Objects
vmadan89
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
siragezeynu
 
Basics of java 1
Basics of java 1Basics of java 1
Basics of java 1
Vijay Kankane
 
Elements of Java Language
Elements of Java Language Elements of Java Language
Elements of Java Language
Hitesh-Java
 
Top 10 Important Core Java Interview questions and answers.pdf
Top 10 Important Core Java Interview questions and answers.pdfTop 10 Important Core Java Interview questions and answers.pdf
Top 10 Important Core Java Interview questions and answers.pdf
Umesh Kumar
 
Understanding And Using Reflection
Understanding And Using ReflectionUnderstanding And Using Reflection
Understanding And Using Reflection
Ganesh Samarthyam
 
Session 02 - Elements of Java Language
Session 02 - Elements of Java LanguageSession 02 - Elements of Java Language
Session 02 - Elements of Java Language
PawanMM
 
Java_presesntation.ppt
Java_presesntation.pptJava_presesntation.ppt
Java_presesntation.ppt
VGaneshKarthikeyan
 
Java1
Java1Java1
Java1
computertuitions
 
Java
Java Java
Java
computertuitions
 
Intro Java Rev010
Intro Java Rev010Intro Java Rev010
Intro Java Rev010
Rich Helton
 
Java interview questions and answers
Java interview questions and answersJava interview questions and answers
Java interview questions and answers
Krishnaov
 
java basic for begginers
java basic for begginersjava basic for begginers
java basic for begginers
divaskrgupta007
 
Jacarashed-1746968053-300050282-Java.ppt
Jacarashed-1746968053-300050282-Java.pptJacarashed-1746968053-300050282-Java.ppt
Jacarashed-1746968053-300050282-Java.ppt
DilipDas70
 
Java For beginners to build a strong foundation
Java For beginners to build a strong foundationJava For beginners to build a strong foundation
Java For beginners to build a strong foundation
Satheesh Chandran
 
DAY_1.1.pptx
DAY_1.1.pptxDAY_1.1.pptx
DAY_1.1.pptx
ishasharma835109
 
Chapter 2.1
Chapter 2.1Chapter 2.1
Chapter 2.1
sotlsoc
 
Professional-core-java-training
Professional-core-java-trainingProfessional-core-java-training
Professional-core-java-training
Vibrant Technologies & Computers
 
01slide (1)ffgfefge
01slide (1)ffgfefge01slide (1)ffgfefge
01slide (1)ffgfefge
bsnl007
 
Classes and Objects
Classes and ObjectsClasses and Objects
Classes and Objects
vmadan89
 
Elements of Java Language
Elements of Java Language Elements of Java Language
Elements of Java Language
Hitesh-Java
 
Top 10 Important Core Java Interview questions and answers.pdf
Top 10 Important Core Java Interview questions and answers.pdfTop 10 Important Core Java Interview questions and answers.pdf
Top 10 Important Core Java Interview questions and answers.pdf
Umesh Kumar
 
Understanding And Using Reflection
Understanding And Using ReflectionUnderstanding And Using Reflection
Understanding And Using Reflection
Ganesh Samarthyam
 
Session 02 - Elements of Java Language
Session 02 - Elements of Java LanguageSession 02 - Elements of Java Language
Session 02 - Elements of Java Language
PawanMM
 
Intro Java Rev010
Intro Java Rev010Intro Java Rev010
Intro Java Rev010
Rich Helton
 
Java interview questions and answers
Java interview questions and answersJava interview questions and answers
Java interview questions and answers
Krishnaov
 
java basic for begginers
java basic for begginersjava basic for begginers
java basic for begginers
divaskrgupta007
 
Jacarashed-1746968053-300050282-Java.ppt
Jacarashed-1746968053-300050282-Java.pptJacarashed-1746968053-300050282-Java.ppt
Jacarashed-1746968053-300050282-Java.ppt
DilipDas70
 
Java For beginners to build a strong foundation
Java For beginners to build a strong foundationJava For beginners to build a strong foundation
Java For beginners to build a strong foundation
Satheesh Chandran
 
Chapter 2.1
Chapter 2.1Chapter 2.1
Chapter 2.1
sotlsoc
 

More from shilpar780389 (6)

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

Recently uploaded (20)

#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Ad

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