SlideShare a Scribd company logo
OOPS and JAVA
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 1
Programming Language
 A programming language is a computer language
programmers use to develop applications, scripts, or
other set of instructions for a computer to perform
specific tasks.
 The commonly used programming methodologies are:
 Procedural programming
 Object-oriented programming (OOP)
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 2
Procedural programming
 Involves dividing a large program into a set of sub-
procedures or subprograms that perform specific tasks.
 Module consists of single or multiple procedures.
 Most of the data is shared as global that can be accessed
from anywhere within the program.
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 3
Procedural programming
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 4
Difficulties in Procedural App
 Focus is on procedures
 All data is shared: no protection
 More difficult to modify
 Hard to manage complexity
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 5
Object Oriented programming
 an approach that provides a way of modularizing
programs by creating partitioned memory area for
both data and functions that can be used as template
for creating copies of such modules on demand.
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 6
Advantages of OOP
 Real-world programming
 Reusability of code
 Modularity of code
 Resilience to change
 Information hiding
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 7
Procedural vs. Object-Oriented
 Procedural
Withdraw, deposit, transfer
 Object Oriented
Customer, money, account
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 8
Procedural vs. Object-Oriented
S. No Procedural Programming Object-Oriented Programming
1 Emphasis on Procedures Emphasis on Data
2 Data is not hidden Data is hidden
3 Data and methods are separate Data and methods are combined using
objects
4 Data can be accessed by external
functions
Data cannot be accessed by external
functions
5 Top-down Approach in program
design
Bottom-up Approach in program
design
6 Eg. C, PASCAL Eg. C++, JAVA, Smalltalk
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 9
OOP Concepts
 Objects
 Classes
 Data Abstraction
 Data Encapsulation
 Inheritance
 Polymorphism
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 10
JAVA
 James Gosling and Sun Microsystems
 Oak
 Java, May 20, 1995, Sun World
 HotJava
 The first Java-enabled Web browser
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 11
JAVA
 James Gosling, Mike Sheridan, and Patrick
Naughton initiated the Java language project in
June 1991. The small team of sun engineers
called Green Team.
 Originally designed for small, embedded
systems in electronic appliances like set-top
boxes.
 Firstly, it was called “Greentalk” by James
Gosling, and file extension was .gt.
 After that, it was called Oak and was
developed as a part of the Green project.
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 12
JAVA
 According to James Gosling, “Java was one of the
top choices along with Silk“.
 Java is an island of Indonesia where first coffee was
produced (called java coffee).
 Notice that Java is just a name, not an acronym.
 In 1995, Time magazine called Java one of the Ten
Best Products of 1995.
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 13
Java Milestones
Year Development
1990 Sun decided to developed special software that could be used
for electronic devices. A project called Green Project created
and headed by James Gosling.
1991 Explored possibility of using C++, with some updates
announced a new language named “Oak”
1992 The team demonstrated the application of their new language
to control a list of home appliances using a hand held device.
1993 The World Wide Web appeared on the Internet and
transformed the text-based interface to a graphical rich
environment. The team developed Web applets (time
programs) that could run on all types of computers connected
to the Internet.
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Java Milestones
Year Development
1994 The team developed a new Web browsed called “Hot Java” to
locate and run Applets. HotJava gained instance success.
1995 Oak was renamed to Java, as it did not survive “legal”
registration. Many companies such as Netscape and
Microsoft announced their support for Java
1996 Java established itself it self as both 1. “the language for
Internet programming” 2. a general purpose OO language.
1997- A class libraries, Community effort and standardization,
Enterprise Java, Clustering, etc..
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Sun white paper defines Java as:
 Simple and Powerful
 Safe
 Object Oriented
 Robust
 Architecture Neutral and Portable
 Interpreted and High Performance
 Threaded
 Dynamic
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 16
Java Attributes
 Familiar, Simple, Small
 Compiled and Interpreted
 Platform-Independent and Portable
 Object-Oriented
 Robust and Secure
 Distributed
 Multithreaded and Interactive
 High Performance
 Dynamic and Extensible
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 17
Overlap of C, C++, and Java
C
C++
Java
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 18
Java better than C++ ?
 No Typedefs, Defines, or Preprocessor
 No Global Variables
 No Pointers
 No Unsafe Structures
 No Multiple Inheritance
 No Operator Overloading
 No Automatic Coercions
 No Fragile Data Types
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 19
Object Oriented Languages -A Comparison
Feature C++ Objective C Ada Java
Encapsulation Yes Yes Yes Yes
Inheritance Yes Yes No Yes
Multiple Inherit. Yes Yes No No
Polymorphism Yes Yes Yes Yes
Binding (Early or Late) Both Both Early Late
Concurrency Poor Poor Difficult Yes
Garbage Collection No Yes No Yes
Genericity Yes No Yes Limited
Class Libraries Yes Yes Limited Yes
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
JDK Editions
 Java Standard Edition (J2SE)
 J2SE can be used to develop client-side standalone
applications or applets.
 Java Enterprise Edition (J2EE)
 J2EE can be used to develop server-side
applications such as Java servlets and Java
ServerPages.
 Java Micro Edition (J2ME).
 J2ME can be used to develop applications for
mobile devices such as cell phones.
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 21
JDK
 Versions
 JDK 1 (1995), JDK 1.2 (1998), JDK 1.3 (2000)
 JDK 1.4 (2002), JDK 1.5 (2004), JDK 6 (2006)
 JDK 7 (2011), JDK 12 (2019), JDK 13 (2019)
 Tools
 appletviewer (for viewing Applets)
 javac (Java Compiler)
 java (Java Interpreter)
 jdb (Java Debugger)
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 22
Java as Portable
 Unlike other language compilers, Java complier
generates code (byte codes) for Universal Machine.
 Java Virtual Machine (JVM): Interprets bytecodes at
runtime
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 23
Java as Portable
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 24
Total Platform Independence
JAVA COMPILER
JAVA BYTE CODE
JAVA INTERPRETER
Windows 95 Macintosh Solaris Windows NT
(translator)
(same for all platforms)
(one for each different system)
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 25
Architecture Neutral & Portable
 Java Compiler - Java source code (file with
extension .java) to bytecode (file with extension
.class)
 Bytecode - an intermediate form, closer to
machine representation
 A interpreter (virtual machine) on any target
platform interprets the bytecode.
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 26
JAVA Program Structure
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 27
First JAVA Application
/* Hello World, first application, only output. */
import java.io.*;
public class Hello
{
public static void main (String [] args)
{
System.out.println(“Java Hello Worldn”);
} //end main
}//end class
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 28
How to get it running
 To compile:
 javac Hello.java
 To run:
 java Hello
 Note:
 Java is CASE SENSITIVE!!
 Whitespace is ignored by compiler
 File name has to be the same as class name in file.
 Need to import necessary class definitions
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 29
Java Path Setting
 On Error:
 Select Computer from the Start menu
 Choose System Properties from the context menu
 Click Advanced system settings > Advanced tab
 Click on Environment Variables, under System Variables, find PATH, and click on it.
 In the Edit windows, modify PATH by adding the location of the class to the value for
PATH.
 Reopen Command prompt window, and run your java code.
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 30
JAVA Keywords
abstract continue for new switch
assert default goto package synchronized
boolean do if private this
break double implements protected throw
byte else import public throws
case enum instanceof return transient
catch extends int short try
char final interface static void
class finally long strictfp volatile
const float native super while
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 31
Primitive Data Types
• Value of primitive type is not considered an object
• java.lang provides wrapper classes for each of
the primitive types
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 1-32
Java Data Types
 Sizes fully specified by Java standard.
 Java is a very strongly typed language
 Integer types
 int (4 bytes signed)
 short (2 bytes signed)
 long (8 bytes signed) use suffix L (eg 1000000000L)
 byte (1 byte signed)
 Floating-point types
 float (4 bytes) use suffix F (eg 1.28F)
 double( 8 bytes)
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 33
Operators
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 1-34
Flow Controls
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 35
End…
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 36

More Related Content

What's hot (20)

Training on Core java | PPT Presentation | Shravan Sanidhya
Training on Core java | PPT Presentation | Shravan SanidhyaTraining on Core java | PPT Presentation | Shravan Sanidhya
Training on Core java | PPT Presentation | Shravan Sanidhya
Shravan Sanidhya
 
Data Types & Variables in JAVA
Data Types & Variables in JAVAData Types & Variables in JAVA
Data Types & Variables in JAVA
Ankita Totala
 
Functional programming
Functional programmingFunctional programming
Functional programming
ijcd
 
Operators in java
Operators in javaOperators in java
Operators in java
yugandhar vadlamudi
 
Form Validation in JavaScript
Form Validation in JavaScriptForm Validation in JavaScript
Form Validation in JavaScript
Ravi Bhadauria
 
JAVA AWT
JAVA AWTJAVA AWT
JAVA AWT
shanmuga rajan
 
Operators php
Operators phpOperators php
Operators php
Chandni Pm
 
Java Programming
Java ProgrammingJava Programming
Java Programming
Elizabeth alexander
 
OOP-1.pptx
OOP-1.pptxOOP-1.pptx
OOP-1.pptx
iansebuabeh
 
CORE JAVA
CORE JAVACORE JAVA
CORE JAVA
PUNE VIDYARTHI GRIHA'S COLLEGE OF ENGINEERING, NASHIK
 
Exception Handling
Exception HandlingException Handling
Exception Handling
Reddhi Basu
 
Java Programming | Java Tutorial For Beginners | Java Training | Edureka
Java Programming | Java Tutorial For Beginners | Java Training | EdurekaJava Programming | Java Tutorial For Beginners | Java Training | Edureka
Java Programming | Java Tutorial For Beginners | Java Training | Edureka
Edureka!
 
Java constructors
Java constructorsJava constructors
Java constructors
QUONTRASOLUTIONS
 
Byte stream classes.49
Byte stream classes.49Byte stream classes.49
Byte stream classes.49
myrajendra
 
Event Handling in java
Event Handling in javaEvent Handling in java
Event Handling in java
Google
 
Event handling
Event handlingEvent handling
Event handling
swapnac12
 
JVM
JVMJVM
JVM
baabtra.com - No. 1 supplier of quality freshers
 
Threads And Synchronization in C#
Threads And Synchronization in C#Threads And Synchronization in C#
Threads And Synchronization in C#
Rizwan Ali
 
History Of JAVA
History Of JAVAHistory Of JAVA
History Of JAVA
ARSLANAHMED107
 
5. stored procedure and functions
5. stored procedure and functions5. stored procedure and functions
5. stored procedure and functions
Amrit Kaur
 

Similar to Java - OOPS and Java Basics (20)

A CASE STUDY JAVA IS SECURE PROGRAMMING LANGUAGE
A CASE STUDY  JAVA IS SECURE PROGRAMMING LANGUAGEA CASE STUDY  JAVA IS SECURE PROGRAMMING LANGUAGE
A CASE STUDY JAVA IS SECURE PROGRAMMING LANGUAGE
Nathan Mathis
 
1.INTRODUCTION TO JAVA_2022 MB.ppt .
1.INTRODUCTION TO JAVA_2022 MB.ppt      .1.INTRODUCTION TO JAVA_2022 MB.ppt      .
1.INTRODUCTION TO JAVA_2022 MB.ppt .
happycocoman
 
1_Introduction to Java.pptx java programming
1_Introduction to Java.pptx java programming1_Introduction to Java.pptx java programming
1_Introduction to Java.pptx java programming
amitraj53904
 
Java ppt-class_Introduction_class_Objects.ppt
Java ppt-class_Introduction_class_Objects.pptJava ppt-class_Introduction_class_Objects.ppt
Java ppt-class_Introduction_class_Objects.ppt
VGaneshKarthikeyan
 
Java Tutorial to Learn Java Programming
Java Tutorial to Learn Java ProgrammingJava Tutorial to Learn Java Programming
Java Tutorial to Learn Java Programming
business Corporate
 
Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)
Pratima Parida
 
Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)
Pratima Parida
 
Overview of Java
Overview of JavaOverview of Java
Overview of Java
Spotle.ai
 
Java ppt-class_basic data types methods definitions
Java ppt-class_basic data types methods definitionsJava ppt-class_basic data types methods definitions
Java ppt-class_basic data types methods definitions
ganeshkarthy
 
Presentation5
Presentation5Presentation5
Presentation5
Natasha Bains
 
Core Java Slides
Core Java SlidesCore Java Slides
Core Java Slides
Vinit Vyas
 
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 Notes .pdf
Java Notes .pdfJava Notes .pdf
Java Notes .pdf
gokulprasanna4
 
10 interesting things about java
10 interesting things about java10 interesting things about java
10 interesting things about java
kanchanmahajan23
 
Java presentation
Java presentationJava presentation
Java presentation
Karan Sareen
 
Elements of Java Language
Elements of Java Language Elements of Java Language
Elements of Java Language
Hitesh-Java
 
Java1
Java1Java1
Java1
computertuitions
 
Java
Java Java
Java
computertuitions
 
Unit-INP.ppt
Unit-INP.pptUnit-INP.ppt
Unit-INP.ppt
Osmania University
 
Java 2 computer science.pptx
Java 2 computer science.pptxJava 2 computer science.pptx
Java 2 computer science.pptx
MUHAMMED MASHAHIL PUKKUNNUMMAL
 
A CASE STUDY JAVA IS SECURE PROGRAMMING LANGUAGE
A CASE STUDY  JAVA IS SECURE PROGRAMMING LANGUAGEA CASE STUDY  JAVA IS SECURE PROGRAMMING LANGUAGE
A CASE STUDY JAVA IS SECURE PROGRAMMING LANGUAGE
Nathan Mathis
 
1.INTRODUCTION TO JAVA_2022 MB.ppt .
1.INTRODUCTION TO JAVA_2022 MB.ppt      .1.INTRODUCTION TO JAVA_2022 MB.ppt      .
1.INTRODUCTION TO JAVA_2022 MB.ppt .
happycocoman
 
1_Introduction to Java.pptx java programming
1_Introduction to Java.pptx java programming1_Introduction to Java.pptx java programming
1_Introduction to Java.pptx java programming
amitraj53904
 
Java ppt-class_Introduction_class_Objects.ppt
Java ppt-class_Introduction_class_Objects.pptJava ppt-class_Introduction_class_Objects.ppt
Java ppt-class_Introduction_class_Objects.ppt
VGaneshKarthikeyan
 
Java Tutorial to Learn Java Programming
Java Tutorial to Learn Java ProgrammingJava Tutorial to Learn Java Programming
Java Tutorial to Learn Java Programming
business Corporate
 
Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)
Pratima Parida
 
Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)
Pratima Parida
 
Overview of Java
Overview of JavaOverview of Java
Overview of Java
Spotle.ai
 
Java ppt-class_basic data types methods definitions
Java ppt-class_basic data types methods definitionsJava ppt-class_basic data types methods definitions
Java ppt-class_basic data types methods definitions
ganeshkarthy
 
Core Java Slides
Core Java SlidesCore Java Slides
Core Java Slides
Vinit Vyas
 
Session 02 - Elements of Java Language
Session 02 - Elements of Java LanguageSession 02 - Elements of Java Language
Session 02 - Elements of Java Language
PawanMM
 
10 interesting things about java
10 interesting things about java10 interesting things about java
10 interesting things about java
kanchanmahajan23
 
Elements of Java Language
Elements of Java Language Elements of Java Language
Elements of Java Language
Hitesh-Java
 
Ad

More from Victer Paul (13)

OOAD - UML - Sequence and Communication Diagrams - Lab
OOAD - UML - Sequence and Communication Diagrams - LabOOAD - UML - Sequence and Communication Diagrams - Lab
OOAD - UML - Sequence and Communication Diagrams - Lab
Victer Paul
 
OOAD - UML - Class and Object Diagrams - Lab
OOAD - UML - Class and Object Diagrams - LabOOAD - UML - Class and Object Diagrams - Lab
OOAD - UML - Class and Object Diagrams - Lab
Victer Paul
 
OOAD - Systems and Object Orientation Concepts
OOAD - Systems and Object Orientation ConceptsOOAD - Systems and Object Orientation Concepts
OOAD - Systems and Object Orientation Concepts
Victer Paul
 
Java - Strings Concepts
Java - Strings ConceptsJava - Strings Concepts
Java - Strings Concepts
Victer Paul
 
Java - Packages Concepts
Java - Packages ConceptsJava - Packages Concepts
Java - Packages Concepts
Victer Paul
 
Java - Exception Handling Concepts
Java - Exception Handling ConceptsJava - Exception Handling Concepts
Java - Exception Handling Concepts
Victer Paul
 
Java - Class Structure
Java - Class StructureJava - Class Structure
Java - Class Structure
Victer Paul
 
Java - Object Oriented Programming Concepts
Java - Object Oriented Programming ConceptsJava - Object Oriented Programming Concepts
Java - Object Oriented Programming Concepts
Victer Paul
 
Java - Basic Concepts
Java - Basic ConceptsJava - Basic Concepts
Java - Basic Concepts
Victer Paul
 
Java - File Input Output Concepts
Java - File Input Output ConceptsJava - File Input Output Concepts
Java - File Input Output Concepts
Victer Paul
 
Java - Inheritance Concepts
Java - Inheritance ConceptsJava - Inheritance Concepts
Java - Inheritance Concepts
Victer Paul
 
Java - Arrays Concepts
Java - Arrays ConceptsJava - Arrays Concepts
Java - Arrays Concepts
Victer Paul
 
Java applet programming concepts
Java  applet programming conceptsJava  applet programming concepts
Java applet programming concepts
Victer Paul
 
OOAD - UML - Sequence and Communication Diagrams - Lab
OOAD - UML - Sequence and Communication Diagrams - LabOOAD - UML - Sequence and Communication Diagrams - Lab
OOAD - UML - Sequence and Communication Diagrams - Lab
Victer Paul
 
OOAD - UML - Class and Object Diagrams - Lab
OOAD - UML - Class and Object Diagrams - LabOOAD - UML - Class and Object Diagrams - Lab
OOAD - UML - Class and Object Diagrams - Lab
Victer Paul
 
OOAD - Systems and Object Orientation Concepts
OOAD - Systems and Object Orientation ConceptsOOAD - Systems and Object Orientation Concepts
OOAD - Systems and Object Orientation Concepts
Victer Paul
 
Java - Strings Concepts
Java - Strings ConceptsJava - Strings Concepts
Java - Strings Concepts
Victer Paul
 
Java - Packages Concepts
Java - Packages ConceptsJava - Packages Concepts
Java - Packages Concepts
Victer Paul
 
Java - Exception Handling Concepts
Java - Exception Handling ConceptsJava - Exception Handling Concepts
Java - Exception Handling Concepts
Victer Paul
 
Java - Class Structure
Java - Class StructureJava - Class Structure
Java - Class Structure
Victer Paul
 
Java - Object Oriented Programming Concepts
Java - Object Oriented Programming ConceptsJava - Object Oriented Programming Concepts
Java - Object Oriented Programming Concepts
Victer Paul
 
Java - Basic Concepts
Java - Basic ConceptsJava - Basic Concepts
Java - Basic Concepts
Victer Paul
 
Java - File Input Output Concepts
Java - File Input Output ConceptsJava - File Input Output Concepts
Java - File Input Output Concepts
Victer Paul
 
Java - Inheritance Concepts
Java - Inheritance ConceptsJava - Inheritance Concepts
Java - Inheritance Concepts
Victer Paul
 
Java - Arrays Concepts
Java - Arrays ConceptsJava - Arrays Concepts
Java - Arrays Concepts
Victer Paul
 
Java applet programming concepts
Java  applet programming conceptsJava  applet programming concepts
Java applet programming concepts
Victer Paul
 
Ad

Recently uploaded (20)

Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free DownloadViral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
 
TimeSeries Machine Learning - PyData London 2025
TimeSeries Machine Learning - PyData London 2025TimeSeries Machine Learning - PyData London 2025
TimeSeries Machine Learning - PyData London 2025
Suyash Joshi
 
Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdfArtificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdfBoosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Alkin Tezuysal
 
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data ResilienceFloods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Safe Software
 
Cisco ISE Performance, Scalability and Best Practices.pdf
Cisco ISE Performance, Scalability and Best Practices.pdfCisco ISE Performance, Scalability and Best Practices.pdf
Cisco ISE Performance, Scalability and Best Practices.pdf
superdpz
 
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven InfrastructureNo-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
 
Enabling BIM / GIS integrations with Other Systems with FME
Enabling BIM / GIS integrations with Other Systems with FMEEnabling BIM / GIS integrations with Other Systems with FME
Enabling BIM / GIS integrations with Other Systems with FME
Safe Software
 
Oracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI ProfessionalOracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI Professional
VICTOR MAESTRE RAMIREZ
 
Introduction to Typescript - GDG On Campus EUE
Introduction to Typescript - GDG On Campus EUEIntroduction to Typescript - GDG On Campus EUE
Introduction to Typescript - GDG On Campus EUE
Google Developer Group On Campus European Universities in Egypt
 
Oracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization ProgramOracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization Program
VICTOR MAESTRE RAMIREZ
 
How to Detect Outliers in IBM SPSS Statistics.pptx
How to Detect Outliers in IBM SPSS Statistics.pptxHow to Detect Outliers in IBM SPSS Statistics.pptx
How to Detect Outliers in IBM SPSS Statistics.pptx
Version 1 Analytics
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
Murdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementaryMurdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementary
JorgeSemperteguiMont
 
If You Use Databricks, You Definitely Need FME
If You Use Databricks, You Definitely Need FMEIf You Use Databricks, You Definitely Need FME
If You Use Databricks, You Definitely Need FME
Safe Software
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
PyData - Graph Theory for Multi-Agent Integration
PyData - Graph Theory for Multi-Agent IntegrationPyData - Graph Theory for Multi-Agent Integration
PyData - Graph Theory for Multi-Agent Integration
barqawicloud
 
Trends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary MeekerTrends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary Meeker
Clive Dickens
 
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free DownloadViral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
 
TimeSeries Machine Learning - PyData London 2025
TimeSeries Machine Learning - PyData London 2025TimeSeries Machine Learning - PyData London 2025
TimeSeries Machine Learning - PyData London 2025
Suyash Joshi
 
Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdfArtificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdfBoosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Alkin Tezuysal
 
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data ResilienceFloods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Safe Software
 
Cisco ISE Performance, Scalability and Best Practices.pdf
Cisco ISE Performance, Scalability and Best Practices.pdfCisco ISE Performance, Scalability and Best Practices.pdf
Cisco ISE Performance, Scalability and Best Practices.pdf
superdpz
 
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven InfrastructureNo-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
 
Enabling BIM / GIS integrations with Other Systems with FME
Enabling BIM / GIS integrations with Other Systems with FMEEnabling BIM / GIS integrations with Other Systems with FME
Enabling BIM / GIS integrations with Other Systems with FME
Safe Software
 
Oracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI ProfessionalOracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI Professional
VICTOR MAESTRE RAMIREZ
 
Oracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization ProgramOracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization Program
VICTOR MAESTRE RAMIREZ
 
How to Detect Outliers in IBM SPSS Statistics.pptx
How to Detect Outliers in IBM SPSS Statistics.pptxHow to Detect Outliers in IBM SPSS Statistics.pptx
How to Detect Outliers in IBM SPSS Statistics.pptx
Version 1 Analytics
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
Murdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementaryMurdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementary
JorgeSemperteguiMont
 
If You Use Databricks, You Definitely Need FME
If You Use Databricks, You Definitely Need FMEIf You Use Databricks, You Definitely Need FME
If You Use Databricks, You Definitely Need FME
Safe Software
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
PyData - Graph Theory for Multi-Agent Integration
PyData - Graph Theory for Multi-Agent IntegrationPyData - Graph Theory for Multi-Agent Integration
PyData - Graph Theory for Multi-Agent Integration
barqawicloud
 
Trends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary MeekerTrends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary Meeker
Clive Dickens
 

Java - OOPS and Java Basics

  • 1. OOPS and JAVA Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 1
  • 2. Programming Language  A programming language is a computer language programmers use to develop applications, scripts, or other set of instructions for a computer to perform specific tasks.  The commonly used programming methodologies are:  Procedural programming  Object-oriented programming (OOP) Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 2
  • 3. Procedural programming  Involves dividing a large program into a set of sub- procedures or subprograms that perform specific tasks.  Module consists of single or multiple procedures.  Most of the data is shared as global that can be accessed from anywhere within the program. Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 3
  • 4. Procedural programming Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 4
  • 5. Difficulties in Procedural App  Focus is on procedures  All data is shared: no protection  More difficult to modify  Hard to manage complexity Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 5
  • 6. Object Oriented programming  an approach that provides a way of modularizing programs by creating partitioned memory area for both data and functions that can be used as template for creating copies of such modules on demand. Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 6
  • 7. Advantages of OOP  Real-world programming  Reusability of code  Modularity of code  Resilience to change  Information hiding Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 7
  • 8. Procedural vs. Object-Oriented  Procedural Withdraw, deposit, transfer  Object Oriented Customer, money, account Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 8
  • 9. Procedural vs. Object-Oriented S. No Procedural Programming Object-Oriented Programming 1 Emphasis on Procedures Emphasis on Data 2 Data is not hidden Data is hidden 3 Data and methods are separate Data and methods are combined using objects 4 Data can be accessed by external functions Data cannot be accessed by external functions 5 Top-down Approach in program design Bottom-up Approach in program design 6 Eg. C, PASCAL Eg. C++, JAVA, Smalltalk Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 9
  • 10. OOP Concepts  Objects  Classes  Data Abstraction  Data Encapsulation  Inheritance  Polymorphism Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 10
  • 11. JAVA  James Gosling and Sun Microsystems  Oak  Java, May 20, 1995, Sun World  HotJava  The first Java-enabled Web browser Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 11
  • 12. JAVA  James Gosling, Mike Sheridan, and Patrick Naughton initiated the Java language project in June 1991. The small team of sun engineers called Green Team.  Originally designed for small, embedded systems in electronic appliances like set-top boxes.  Firstly, it was called “Greentalk” by James Gosling, and file extension was .gt.  After that, it was called Oak and was developed as a part of the Green project. Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 12
  • 13. JAVA  According to James Gosling, “Java was one of the top choices along with Silk“.  Java is an island of Indonesia where first coffee was produced (called java coffee).  Notice that Java is just a name, not an acronym.  In 1995, Time magazine called Java one of the Ten Best Products of 1995. Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 13
  • 14. Java Milestones Year Development 1990 Sun decided to developed special software that could be used for electronic devices. A project called Green Project created and headed by James Gosling. 1991 Explored possibility of using C++, with some updates announced a new language named “Oak” 1992 The team demonstrated the application of their new language to control a list of home appliances using a hand held device. 1993 The World Wide Web appeared on the Internet and transformed the text-based interface to a graphical rich environment. The team developed Web applets (time programs) that could run on all types of computers connected to the Internet. Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 15. Java Milestones Year Development 1994 The team developed a new Web browsed called “Hot Java” to locate and run Applets. HotJava gained instance success. 1995 Oak was renamed to Java, as it did not survive “legal” registration. Many companies such as Netscape and Microsoft announced their support for Java 1996 Java established itself it self as both 1. “the language for Internet programming” 2. a general purpose OO language. 1997- A class libraries, Community effort and standardization, Enterprise Java, Clustering, etc.. Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 16. Sun white paper defines Java as:  Simple and Powerful  Safe  Object Oriented  Robust  Architecture Neutral and Portable  Interpreted and High Performance  Threaded  Dynamic Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 16
  • 17. Java Attributes  Familiar, Simple, Small  Compiled and Interpreted  Platform-Independent and Portable  Object-Oriented  Robust and Secure  Distributed  Multithreaded and Interactive  High Performance  Dynamic and Extensible Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 17
  • 18. Overlap of C, C++, and Java C C++ Java Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 18
  • 19. Java better than C++ ?  No Typedefs, Defines, or Preprocessor  No Global Variables  No Pointers  No Unsafe Structures  No Multiple Inheritance  No Operator Overloading  No Automatic Coercions  No Fragile Data Types Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 19
  • 20. Object Oriented Languages -A Comparison Feature C++ Objective C Ada Java Encapsulation Yes Yes Yes Yes Inheritance Yes Yes No Yes Multiple Inherit. Yes Yes No No Polymorphism Yes Yes Yes Yes Binding (Early or Late) Both Both Early Late Concurrency Poor Poor Difficult Yes Garbage Collection No Yes No Yes Genericity Yes No Yes Limited Class Libraries Yes Yes Limited Yes Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 21. JDK Editions  Java Standard Edition (J2SE)  J2SE can be used to develop client-side standalone applications or applets.  Java Enterprise Edition (J2EE)  J2EE can be used to develop server-side applications such as Java servlets and Java ServerPages.  Java Micro Edition (J2ME).  J2ME can be used to develop applications for mobile devices such as cell phones. Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 21
  • 22. JDK  Versions  JDK 1 (1995), JDK 1.2 (1998), JDK 1.3 (2000)  JDK 1.4 (2002), JDK 1.5 (2004), JDK 6 (2006)  JDK 7 (2011), JDK 12 (2019), JDK 13 (2019)  Tools  appletviewer (for viewing Applets)  javac (Java Compiler)  java (Java Interpreter)  jdb (Java Debugger) Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 22
  • 23. Java as Portable  Unlike other language compilers, Java complier generates code (byte codes) for Universal Machine.  Java Virtual Machine (JVM): Interprets bytecodes at runtime Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 23
  • 24. Java as Portable Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 24
  • 25. Total Platform Independence JAVA COMPILER JAVA BYTE CODE JAVA INTERPRETER Windows 95 Macintosh Solaris Windows NT (translator) (same for all platforms) (one for each different system) Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 25
  • 26. Architecture Neutral & Portable  Java Compiler - Java source code (file with extension .java) to bytecode (file with extension .class)  Bytecode - an intermediate form, closer to machine representation  A interpreter (virtual machine) on any target platform interprets the bytecode. Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 26
  • 27. JAVA Program Structure Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 27
  • 28. First JAVA Application /* Hello World, first application, only output. */ import java.io.*; public class Hello { public static void main (String [] args) { System.out.println(“Java Hello Worldn”); } //end main }//end class Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 28
  • 29. How to get it running  To compile:  javac Hello.java  To run:  java Hello  Note:  Java is CASE SENSITIVE!!  Whitespace is ignored by compiler  File name has to be the same as class name in file.  Need to import necessary class definitions Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 29
  • 30. Java Path Setting  On Error:  Select Computer from the Start menu  Choose System Properties from the context menu  Click Advanced system settings > Advanced tab  Click on Environment Variables, under System Variables, find PATH, and click on it.  In the Edit windows, modify PATH by adding the location of the class to the value for PATH.  Reopen Command prompt window, and run your java code. Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 30
  • 31. JAVA Keywords abstract continue for new switch assert default goto package synchronized boolean do if private this break double implements protected throw byte else import public throws case enum instanceof return transient catch extends int short try char final interface static void class finally long strictfp volatile const float native super while Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 31
  • 32. Primitive Data Types • Value of primitive type is not considered an object • java.lang provides wrapper classes for each of the primitive types Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 1-32
  • 33. Java Data Types  Sizes fully specified by Java standard.  Java is a very strongly typed language  Integer types  int (4 bytes signed)  short (2 bytes signed)  long (8 bytes signed) use suffix L (eg 1000000000L)  byte (1 byte signed)  Floating-point types  float (4 bytes) use suffix F (eg 1.28F)  double( 8 bytes) Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 33
  • 34. Operators Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 1-34
  • 35. Flow Controls Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 35
  • 36. End… Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 36