SlideShare a Scribd company logo
Introducing Java
Course Code: CSC 1205
Dept. of Computer Science
Faculty of Science and Technology
Lecturer No: 1 Week No: 1 Semester: Summer 21-22
Lecturer: Mazid-Ul-Haque, mazid@aiub.edu
Course Title: Object Oriented Programming 1
Lecture Outline
1. History of Programming Languages
2. Importance of OOP
3. Java as OOP Language
4. JVM Architecture
5. Hello World Program
History of Programming Languages
What is Programming Language
“Instead of imagining that our main task is to instruct a computer what to do, let
us concentrate rather on explaining to human beings what we want a computer
to do.” - Donald Knuth
A programming language is an artificial language that can be used to control the
behavior of a machine, particularly a computer. Programming languages, like
human languages, are defined using syntactic and semantic rules, to determine
structure and meaning, respectively.
History of Programming Languages
Evolution of Programming Languages
Epoch Description Languages
1950’s Creation of high-level languages Assembly, Fortran
1960’s Expansion of specialized languages Simula, Lisp, Cobol
1970’s
Duel between structured programming with
Pascal and efficiency of C language
C, Pascal
1980’s Experimenting other ways including objects Smalltalk, C++
1990’s
Generalization of object-oriented programming
with the performance of microcomputers
Java, Perl, Python,
PHP
2000’s Internet Programming C#, Scala
2010’s Concurrency and asynchronicity JavaScript, Go
History of Programming Languages
The Creation of Java
• Java was conceived by James Gosling, Patrick Naughton, Chris Warth, Ed
Frank, and Mike Sheridan at Sun Microsystems, Inc. in 1991.
• It took 18 months to develop the first working version.
• This language was initially called Oak but was renamed Java in 1995.
• The primary motivation was the need for a platform-independent language,
not the internet.
Importance of OOP
What is an Object
• Objects are key to understanding object-oriented technology.
• Real-world objects share two characteristics: They all have state and behavior.
• Example:
• Dogs have state (name, color, breed, hungry) and behavior (barking,
fetching, wagging tail)
• Bicycles also have state (current gear, current pedal cadence, current
speed) and behavior (changing gear, changing pedal cadence, applying
brakes)
Importance of OOP
What is OOP
Object Oriented Programming (OOP) is a programming methodology that helps
organize complex programs using inheritance, encapsulation, and
polymorphism.
Importance of OOP
Why OOP
• Throughout the history of programming, the increasing complexity of
programs has driven the need for better ways to manage complexity.
• Object Oriented Programming (OOP) was developed as there were limitations
in earlier approaches.
• Process-oriented model was one of the earlier approaches to Object-oriented
programming
• To clearly understand the importance of object-oriented programming, we
need to know about the process-oriented model
Importance of OOP
Why OOP (Process-Oriented Model)
All computer programs consists of two elements: a) code (what is happening) b)
data (who is being affected)
Process-Oriented Model:
 This approach characterizes a program as a series of linear steps (that is,
code).
 In this model, programs are typically organized around code. This approach
can be thought of as code acting on data.
 Procedural languages such as C employ this model to considerable success.
 In procedural programming, program is divided into small parts called
functions.
 Procedural programming follows top down approach.
 In procedural programming, function is more important than data.
Importance of OOP
Why OOP (Process-Oriented Model)
 In multi-function program, important data items are placed as global so that
they may be accessed by all functions
 Procedural programming is based on unreal world.
Importance of OOP
Why OOP (Drawbacks of Process-Oriented Model)
 Problems with this approach appear as programs grow larger and more
complex.
 As function has complete access to the global variables, it is possible that new
programmer can corrupt the data accidentally by creating functions.
 Data is exposed to whole program, so no security for data.
 In large program it is very difficult to identify what data is used by which
function.
 Difficult to relate with real world objects.
 Difficult to create new data types reduces extensibility.
 Importance is given to the operation on data rather that the data.
Importance of OOP
Why OOP (Object-Oriented Programming)
 Object-oriented programming organizes a program around its data (that is,
objects) and a set of well-defined interfaces to that data.
 An object-oriented program can be characterized as data controlling access to
code.
 In OOP, problem is divided into the number of entities called objects and then
builds data and methods around these objects.
 It binds the data more closely to the method that operate on it and protects it
from accidental modification.
 Data of an object can be accessed only by the methods associated with the
object.
 Follows bottom up approach.
 Increases code reusability and maintainability.
Importance of OOP
Why OOP is Important
 Modularity for easier troubleshooting.
 Reuse of code through inheritance.
 Flexibility through polymorphism.
 Effective problem solving.
Java as OOP Language
Why Java is Object Oriented
 It is not possible to code in java without class and object. Even to write a
single hello world program, we need to declare a class.
 Java supports encapsulation.
 Java supports abstraction.
 Java supports inheritance.
 Java supports polymorphism.
JVM Architecture
Introduction to JVM
 JVM(Java Virtual Machine) acts as a run-time engine to run Java applications.
 It converts Java bytecode into machines language
 JVM is a part of JRE(Java Runtime Environment).
JVM Architecture
How JVM Works
 In the Java programming language, all source code is first written in plain text
files ending with the .java extension.
 Those source files are then compiled into .class files by the javac compiler.
 A .class file does not contain code that is native to your processor; it instead
contains bytecodes—the machine language of the Java Virtual Machine (Java
VM).
 The java launcher tool then runs application with an instance of the Java
Virtual Machine.
JVM Architecture
Why Java is Platform Independent
 The meaning of platform-independent is that the java compiled code(byte
code) can run on all operating systems.
 The Java VM is available on many different operating systems.
 As a result, the same .class files can run on Microsoft Windows, Linux, Mac OS
and so on.
Hello World Program
Basic Hello World Program
 Create a HelloWorld.java source file.
 Write the following code in the source file.
Hello World Program
How to Execute Hello World Program
 To compile HelloWorld.java, use the compiler. If successful, it will produce a
file called HelloWorld.class in the same directory.
> javac HelloWorld.java
 To execute, run the Java VM and include the name of the class which contains
the "main" method as the first command line parameter.
> java HelloWorld
Books
1. Java The Complete Reference- Ninth Edition by Herbert Schildt
2. Head First Java, By Kathy Sierra and Bert Bates
References
• https://www.cs.mcgill.ca/~rwest/wikispeedia/wpcd/wp/p/Progra
mming_language.htm
• https://www.scriptol.com/programming/history.php
• https://docs.oracle.com/javase/tutorial/
Ad

More Related Content

Similar to Lecture 1.1 - Introducing Java.pptx3eeeee (20)

JAVA
JAVAJAVA
JAVA
sonali_iul
 
INTRODUCTION TO JAVA
INTRODUCTION TO JAVAINTRODUCTION TO JAVA
INTRODUCTION TO JAVA
RAMALINGHAM KRISHNAMOORTHY
 
Elements of Java Language
Elements of Java Language Elements of Java Language
Elements of Java Language
Hitesh-Java
 
PJ_M01_C01_PPT_Introduction to Object Oriented Programming Using Java.pdf
PJ_M01_C01_PPT_Introduction to Object Oriented Programming Using Java.pdfPJ_M01_C01_PPT_Introduction to Object Oriented Programming Using Java.pdf
PJ_M01_C01_PPT_Introduction to Object Oriented Programming Using Java.pdf
projectfora2
 
Share Unit 1- Basic concept of object-oriented-programming.ppt
Share Unit 1- Basic concept of object-oriented-programming.pptShare Unit 1- Basic concept of object-oriented-programming.ppt
Share Unit 1- Basic concept of object-oriented-programming.ppt
hannahrroselin95
 
JAVA_VR23_OOPS THROUGH JAVA PPT UNIT-1.pptx
JAVA_VR23_OOPS THROUGH JAVA PPT UNIT-1.pptxJAVA_VR23_OOPS THROUGH JAVA PPT UNIT-1.pptx
JAVA_VR23_OOPS THROUGH JAVA PPT UNIT-1.pptx
netaji10700
 
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 object oriented programming (oop).ppt
JAVA object oriented programming (oop).pptJAVA object oriented programming (oop).ppt
JAVA object oriented programming (oop).ppt
AliyaJav
 
Object Oriented programming - Introduction
Object Oriented programming - IntroductionObject Oriented programming - Introduction
Object Oriented programming - Introduction
Madishetty Prathibha
 
6_Object-oriented-using-java.pdf object oriented programming concepts
6_Object-oriented-using-java.pdf object oriented programming concepts6_Object-oriented-using-java.pdf object oriented programming concepts
6_Object-oriented-using-java.pdf object oriented programming concepts
harinipradeep15
 
java oops compilation object class inheritance.pptx
java oops compilation object class inheritance.pptxjava oops compilation object class inheritance.pptx
java oops compilation object class inheritance.pptx
CHERUKURIYUVARAJU209
 
java oops and java very important for .pptx
java oops and java very important for .pptxjava oops and java very important for .pptx
java oops and java very important for .pptx
cherukuriyuvaraju9
 
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
 
ICT-DBA4 -05-0811-Apply-Object-Oriented-Programming-Language-Skills.doc
ICT-DBA4 -05-0811-Apply-Object-Oriented-Programming-Language-Skills.docICT-DBA4 -05-0811-Apply-Object-Oriented-Programming-Language-Skills.doc
ICT-DBA4 -05-0811-Apply-Object-Oriented-Programming-Language-Skills.doc
AmanGunner
 
Unit 1 Core Java for Compter Science 3rd
Unit 1 Core Java for Compter Science 3rdUnit 1 Core Java for Compter Science 3rd
Unit 1 Core Java for Compter Science 3rd
prat0ham
 
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
 
What is java?-Saurabh Upadhyay
What is java?-Saurabh UpadhyayWhat is java?-Saurabh Upadhyay
What is java?-Saurabh Upadhyay
Saurabh Upadhyay
 
Unit1 introduction to Java
Unit1 introduction to JavaUnit1 introduction to Java
Unit1 introduction to Java
DevaKumari Vijay
 
JavaClassPresentation
JavaClassPresentationJavaClassPresentation
JavaClassPresentation
juliasceasor
 
Untitled presentation about object oriented.pptx
Untitled presentation about object oriented.pptxUntitled presentation about object oriented.pptx
Untitled presentation about object oriented.pptx
janetvidyaanancys
 
Elements of Java Language
Elements of Java Language Elements of Java Language
Elements of Java Language
Hitesh-Java
 
PJ_M01_C01_PPT_Introduction to Object Oriented Programming Using Java.pdf
PJ_M01_C01_PPT_Introduction to Object Oriented Programming Using Java.pdfPJ_M01_C01_PPT_Introduction to Object Oriented Programming Using Java.pdf
PJ_M01_C01_PPT_Introduction to Object Oriented Programming Using Java.pdf
projectfora2
 
Share Unit 1- Basic concept of object-oriented-programming.ppt
Share Unit 1- Basic concept of object-oriented-programming.pptShare Unit 1- Basic concept of object-oriented-programming.ppt
Share Unit 1- Basic concept of object-oriented-programming.ppt
hannahrroselin95
 
JAVA_VR23_OOPS THROUGH JAVA PPT UNIT-1.pptx
JAVA_VR23_OOPS THROUGH JAVA PPT UNIT-1.pptxJAVA_VR23_OOPS THROUGH JAVA PPT UNIT-1.pptx
JAVA_VR23_OOPS THROUGH JAVA PPT UNIT-1.pptx
netaji10700
 
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 object oriented programming (oop).ppt
JAVA object oriented programming (oop).pptJAVA object oriented programming (oop).ppt
JAVA object oriented programming (oop).ppt
AliyaJav
 
Object Oriented programming - Introduction
Object Oriented programming - IntroductionObject Oriented programming - Introduction
Object Oriented programming - Introduction
Madishetty Prathibha
 
6_Object-oriented-using-java.pdf object oriented programming concepts
6_Object-oriented-using-java.pdf object oriented programming concepts6_Object-oriented-using-java.pdf object oriented programming concepts
6_Object-oriented-using-java.pdf object oriented programming concepts
harinipradeep15
 
java oops compilation object class inheritance.pptx
java oops compilation object class inheritance.pptxjava oops compilation object class inheritance.pptx
java oops compilation object class inheritance.pptx
CHERUKURIYUVARAJU209
 
java oops and java very important for .pptx
java oops and java very important for .pptxjava oops and java very important for .pptx
java oops and java very important for .pptx
cherukuriyuvaraju9
 
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
 
ICT-DBA4 -05-0811-Apply-Object-Oriented-Programming-Language-Skills.doc
ICT-DBA4 -05-0811-Apply-Object-Oriented-Programming-Language-Skills.docICT-DBA4 -05-0811-Apply-Object-Oriented-Programming-Language-Skills.doc
ICT-DBA4 -05-0811-Apply-Object-Oriented-Programming-Language-Skills.doc
AmanGunner
 
Unit 1 Core Java for Compter Science 3rd
Unit 1 Core Java for Compter Science 3rdUnit 1 Core Java for Compter Science 3rd
Unit 1 Core Java for Compter Science 3rd
prat0ham
 
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
 
What is java?-Saurabh Upadhyay
What is java?-Saurabh UpadhyayWhat is java?-Saurabh Upadhyay
What is java?-Saurabh Upadhyay
Saurabh Upadhyay
 
Unit1 introduction to Java
Unit1 introduction to JavaUnit1 introduction to Java
Unit1 introduction to Java
DevaKumari Vijay
 
JavaClassPresentation
JavaClassPresentationJavaClassPresentation
JavaClassPresentation
juliasceasor
 
Untitled presentation about object oriented.pptx
Untitled presentation about object oriented.pptxUntitled presentation about object oriented.pptx
Untitled presentation about object oriented.pptx
janetvidyaanancys
 

Recently uploaded (20)

Best Ever Guide To Purchased Verified Wise Accounts ( Personal & Business ).pdf
Best Ever Guide To Purchased Verified Wise Accounts ( Personal & Business ).pdfBest Ever Guide To Purchased Verified Wise Accounts ( Personal & Business ).pdf
Best Ever Guide To Purchased Verified Wise Accounts ( Personal & Business ).pdf
Topvasmm
 
2_English_Vocabulary_In_Use_Pre-Intermediate_Cambridge_-_Fourth_Edition (1).pdf
2_English_Vocabulary_In_Use_Pre-Intermediate_Cambridge_-_Fourth_Edition (1).pdf2_English_Vocabulary_In_Use_Pre-Intermediate_Cambridge_-_Fourth_Edition (1).pdf
2_English_Vocabulary_In_Use_Pre-Intermediate_Cambridge_-_Fourth_Edition (1).pdf
ThiNgc22
 
NewBase 08 May 2025 Energy News issue - 1786 by Khaled Al Awadi_compressed.pdf
NewBase 08 May 2025  Energy News issue - 1786 by Khaled Al Awadi_compressed.pdfNewBase 08 May 2025  Energy News issue - 1786 by Khaled Al Awadi_compressed.pdf
NewBase 08 May 2025 Energy News issue - 1786 by Khaled Al Awadi_compressed.pdf
Khaled Al Awadi
 
Mastering Fact-Oriented Modeling with Natural Language: The Future of Busines...
Mastering Fact-Oriented Modeling with Natural Language: The Future of Busines...Mastering Fact-Oriented Modeling with Natural Language: The Future of Busines...
Mastering Fact-Oriented Modeling with Natural Language: The Future of Busines...
Marco Wobben
 
NAASCO Aircraft Strobe Lights: Enhancing Safety and Visibility in Aviation
NAASCO Aircraft Strobe Lights: Enhancing Safety and Visibility in AviationNAASCO Aircraft Strobe Lights: Enhancing Safety and Visibility in Aviation
NAASCO Aircraft Strobe Lights: Enhancing Safety and Visibility in Aviation
NAASCO
 
How To Think Like Rick Rubin - Shaan Puri.pdf
How To Think Like Rick Rubin - Shaan Puri.pdfHow To Think Like Rick Rubin - Shaan Puri.pdf
How To Think Like Rick Rubin - Shaan Puri.pdf
Razin Mustafiz
 
Strategic Enterprise Management - Unit I.pptx
Strategic Enterprise Management - Unit I.pptxStrategic Enterprise Management - Unit I.pptx
Strategic Enterprise Management - Unit I.pptx
PrekshyaRana
 
ElizabethMarinoWeek4FinalPresentation.pptx
ElizabethMarinoWeek4FinalPresentation.pptxElizabethMarinoWeek4FinalPresentation.pptx
ElizabethMarinoWeek4FinalPresentation.pptx
LizMarino6
 
Best 11 Website To Buy Verified Payoneer Account With SSN Verified.pdf
Best 11 Website To Buy Verified Payoneer Account With SSN Verified.pdfBest 11 Website To Buy Verified Payoneer Account With SSN Verified.pdf
Best 11 Website To Buy Verified Payoneer Account With SSN Verified.pdf
Topvasmm
 
The Profitability Paradox: How Dunzo Can Scale AOV While Maintaining Liquidity
The Profitability Paradox: How Dunzo Can Scale AOV While Maintaining LiquidityThe Profitability Paradox: How Dunzo Can Scale AOV While Maintaining Liquidity
The Profitability Paradox: How Dunzo Can Scale AOV While Maintaining Liquidity
xnayankumar
 
The Fascinating World of Hats: A Brief History of Hats
The Fascinating World of Hats: A Brief History of HatsThe Fascinating World of Hats: A Brief History of Hats
The Fascinating World of Hats: A Brief History of Hats
nimrabilal030
 
Banking Doesn't Have to Be Boring: Jupiter's Gamification Playbook
Banking Doesn't Have to Be Boring: Jupiter's Gamification PlaybookBanking Doesn't Have to Be Boring: Jupiter's Gamification Playbook
Banking Doesn't Have to Be Boring: Jupiter's Gamification Playbook
xnayankumar
 
The USA’s Most Innovative Startup Company of 2025.pdf
The USA’s Most Innovative Startup Company of 2025.pdfThe USA’s Most Innovative Startup Company of 2025.pdf
The USA’s Most Innovative Startup Company of 2025.pdf
insightssuccess2
 
Alan Stalcup - The Enterprising CEO
Alan  Stalcup  -  The  Enterprising  CEOAlan  Stalcup  -  The  Enterprising  CEO
Alan Stalcup - The Enterprising CEO
Alan Stalcup
 
China Visa Update: New Interview Rule at Delhi Embassy | BTW Visa Services
China Visa Update: New Interview Rule at Delhi Embassy | BTW Visa ServicesChina Visa Update: New Interview Rule at Delhi Embassy | BTW Visa Services
China Visa Update: New Interview Rule at Delhi Embassy | BTW Visa Services
siddheshwaryadav696
 
Bloomberg Asia's Power Players in Healthcare - The Visionaries Transforming a...
Bloomberg Asia's Power Players in Healthcare - The Visionaries Transforming a...Bloomberg Asia's Power Players in Healthcare - The Visionaries Transforming a...
Bloomberg Asia's Power Players in Healthcare - The Visionaries Transforming a...
Ignite Capital
 
Mr. Kalifornia Portfolio Group Project Full Sail University
Mr. Kalifornia Portfolio Group Project Full Sail UniversityMr. Kalifornia Portfolio Group Project Full Sail University
Mr. Kalifornia Portfolio Group Project Full Sail University
bmdecker1
 
India Baby Care Products Market Size & Growth | Share Report 2034
India Baby Care Products Market Size & Growth | Share Report 2034India Baby Care Products Market Size & Growth | Share Report 2034
India Baby Care Products Market Size & Growth | Share Report 2034
Aman Bansal
 
HyperVerge's journey from $10M to $30M ARR: Commoditize Your Complements
HyperVerge's journey from $10M to $30M ARR: Commoditize Your ComplementsHyperVerge's journey from $10M to $30M ARR: Commoditize Your Complements
HyperVerge's journey from $10M to $30M ARR: Commoditize Your Complements
xnayankumar
 
How to Transform your Marketing Using AI
How to Transform your Marketing Using AIHow to Transform your Marketing Using AI
How to Transform your Marketing Using AI
Client Marketing Ltd
 
Best Ever Guide To Purchased Verified Wise Accounts ( Personal & Business ).pdf
Best Ever Guide To Purchased Verified Wise Accounts ( Personal & Business ).pdfBest Ever Guide To Purchased Verified Wise Accounts ( Personal & Business ).pdf
Best Ever Guide To Purchased Verified Wise Accounts ( Personal & Business ).pdf
Topvasmm
 
2_English_Vocabulary_In_Use_Pre-Intermediate_Cambridge_-_Fourth_Edition (1).pdf
2_English_Vocabulary_In_Use_Pre-Intermediate_Cambridge_-_Fourth_Edition (1).pdf2_English_Vocabulary_In_Use_Pre-Intermediate_Cambridge_-_Fourth_Edition (1).pdf
2_English_Vocabulary_In_Use_Pre-Intermediate_Cambridge_-_Fourth_Edition (1).pdf
ThiNgc22
 
NewBase 08 May 2025 Energy News issue - 1786 by Khaled Al Awadi_compressed.pdf
NewBase 08 May 2025  Energy News issue - 1786 by Khaled Al Awadi_compressed.pdfNewBase 08 May 2025  Energy News issue - 1786 by Khaled Al Awadi_compressed.pdf
NewBase 08 May 2025 Energy News issue - 1786 by Khaled Al Awadi_compressed.pdf
Khaled Al Awadi
 
Mastering Fact-Oriented Modeling with Natural Language: The Future of Busines...
Mastering Fact-Oriented Modeling with Natural Language: The Future of Busines...Mastering Fact-Oriented Modeling with Natural Language: The Future of Busines...
Mastering Fact-Oriented Modeling with Natural Language: The Future of Busines...
Marco Wobben
 
NAASCO Aircraft Strobe Lights: Enhancing Safety and Visibility in Aviation
NAASCO Aircraft Strobe Lights: Enhancing Safety and Visibility in AviationNAASCO Aircraft Strobe Lights: Enhancing Safety and Visibility in Aviation
NAASCO Aircraft Strobe Lights: Enhancing Safety and Visibility in Aviation
NAASCO
 
How To Think Like Rick Rubin - Shaan Puri.pdf
How To Think Like Rick Rubin - Shaan Puri.pdfHow To Think Like Rick Rubin - Shaan Puri.pdf
How To Think Like Rick Rubin - Shaan Puri.pdf
Razin Mustafiz
 
Strategic Enterprise Management - Unit I.pptx
Strategic Enterprise Management - Unit I.pptxStrategic Enterprise Management - Unit I.pptx
Strategic Enterprise Management - Unit I.pptx
PrekshyaRana
 
ElizabethMarinoWeek4FinalPresentation.pptx
ElizabethMarinoWeek4FinalPresentation.pptxElizabethMarinoWeek4FinalPresentation.pptx
ElizabethMarinoWeek4FinalPresentation.pptx
LizMarino6
 
Best 11 Website To Buy Verified Payoneer Account With SSN Verified.pdf
Best 11 Website To Buy Verified Payoneer Account With SSN Verified.pdfBest 11 Website To Buy Verified Payoneer Account With SSN Verified.pdf
Best 11 Website To Buy Verified Payoneer Account With SSN Verified.pdf
Topvasmm
 
The Profitability Paradox: How Dunzo Can Scale AOV While Maintaining Liquidity
The Profitability Paradox: How Dunzo Can Scale AOV While Maintaining LiquidityThe Profitability Paradox: How Dunzo Can Scale AOV While Maintaining Liquidity
The Profitability Paradox: How Dunzo Can Scale AOV While Maintaining Liquidity
xnayankumar
 
The Fascinating World of Hats: A Brief History of Hats
The Fascinating World of Hats: A Brief History of HatsThe Fascinating World of Hats: A Brief History of Hats
The Fascinating World of Hats: A Brief History of Hats
nimrabilal030
 
Banking Doesn't Have to Be Boring: Jupiter's Gamification Playbook
Banking Doesn't Have to Be Boring: Jupiter's Gamification PlaybookBanking Doesn't Have to Be Boring: Jupiter's Gamification Playbook
Banking Doesn't Have to Be Boring: Jupiter's Gamification Playbook
xnayankumar
 
The USA’s Most Innovative Startup Company of 2025.pdf
The USA’s Most Innovative Startup Company of 2025.pdfThe USA’s Most Innovative Startup Company of 2025.pdf
The USA’s Most Innovative Startup Company of 2025.pdf
insightssuccess2
 
Alan Stalcup - The Enterprising CEO
Alan  Stalcup  -  The  Enterprising  CEOAlan  Stalcup  -  The  Enterprising  CEO
Alan Stalcup - The Enterprising CEO
Alan Stalcup
 
China Visa Update: New Interview Rule at Delhi Embassy | BTW Visa Services
China Visa Update: New Interview Rule at Delhi Embassy | BTW Visa ServicesChina Visa Update: New Interview Rule at Delhi Embassy | BTW Visa Services
China Visa Update: New Interview Rule at Delhi Embassy | BTW Visa Services
siddheshwaryadav696
 
Bloomberg Asia's Power Players in Healthcare - The Visionaries Transforming a...
Bloomberg Asia's Power Players in Healthcare - The Visionaries Transforming a...Bloomberg Asia's Power Players in Healthcare - The Visionaries Transforming a...
Bloomberg Asia's Power Players in Healthcare - The Visionaries Transforming a...
Ignite Capital
 
Mr. Kalifornia Portfolio Group Project Full Sail University
Mr. Kalifornia Portfolio Group Project Full Sail UniversityMr. Kalifornia Portfolio Group Project Full Sail University
Mr. Kalifornia Portfolio Group Project Full Sail University
bmdecker1
 
India Baby Care Products Market Size & Growth | Share Report 2034
India Baby Care Products Market Size & Growth | Share Report 2034India Baby Care Products Market Size & Growth | Share Report 2034
India Baby Care Products Market Size & Growth | Share Report 2034
Aman Bansal
 
HyperVerge's journey from $10M to $30M ARR: Commoditize Your Complements
HyperVerge's journey from $10M to $30M ARR: Commoditize Your ComplementsHyperVerge's journey from $10M to $30M ARR: Commoditize Your Complements
HyperVerge's journey from $10M to $30M ARR: Commoditize Your Complements
xnayankumar
 
How to Transform your Marketing Using AI
How to Transform your Marketing Using AIHow to Transform your Marketing Using AI
How to Transform your Marketing Using AI
Client Marketing Ltd
 
Ad

Lecture 1.1 - Introducing Java.pptx3eeeee

  • 1. Introducing Java Course Code: CSC 1205 Dept. of Computer Science Faculty of Science and Technology Lecturer No: 1 Week No: 1 Semester: Summer 21-22 Lecturer: Mazid-Ul-Haque, [email protected] Course Title: Object Oriented Programming 1
  • 2. Lecture Outline 1. History of Programming Languages 2. Importance of OOP 3. Java as OOP Language 4. JVM Architecture 5. Hello World Program
  • 3. History of Programming Languages What is Programming Language “Instead of imagining that our main task is to instruct a computer what to do, let us concentrate rather on explaining to human beings what we want a computer to do.” - Donald Knuth A programming language is an artificial language that can be used to control the behavior of a machine, particularly a computer. Programming languages, like human languages, are defined using syntactic and semantic rules, to determine structure and meaning, respectively.
  • 4. History of Programming Languages Evolution of Programming Languages Epoch Description Languages 1950’s Creation of high-level languages Assembly, Fortran 1960’s Expansion of specialized languages Simula, Lisp, Cobol 1970’s Duel between structured programming with Pascal and efficiency of C language C, Pascal 1980’s Experimenting other ways including objects Smalltalk, C++ 1990’s Generalization of object-oriented programming with the performance of microcomputers Java, Perl, Python, PHP 2000’s Internet Programming C#, Scala 2010’s Concurrency and asynchronicity JavaScript, Go
  • 5. History of Programming Languages The Creation of Java • Java was conceived by James Gosling, Patrick Naughton, Chris Warth, Ed Frank, and Mike Sheridan at Sun Microsystems, Inc. in 1991. • It took 18 months to develop the first working version. • This language was initially called Oak but was renamed Java in 1995. • The primary motivation was the need for a platform-independent language, not the internet.
  • 6. Importance of OOP What is an Object • Objects are key to understanding object-oriented technology. • Real-world objects share two characteristics: They all have state and behavior. • Example: • Dogs have state (name, color, breed, hungry) and behavior (barking, fetching, wagging tail) • Bicycles also have state (current gear, current pedal cadence, current speed) and behavior (changing gear, changing pedal cadence, applying brakes)
  • 7. Importance of OOP What is OOP Object Oriented Programming (OOP) is a programming methodology that helps organize complex programs using inheritance, encapsulation, and polymorphism.
  • 8. Importance of OOP Why OOP • Throughout the history of programming, the increasing complexity of programs has driven the need for better ways to manage complexity. • Object Oriented Programming (OOP) was developed as there were limitations in earlier approaches. • Process-oriented model was one of the earlier approaches to Object-oriented programming • To clearly understand the importance of object-oriented programming, we need to know about the process-oriented model
  • 9. Importance of OOP Why OOP (Process-Oriented Model) All computer programs consists of two elements: a) code (what is happening) b) data (who is being affected) Process-Oriented Model:  This approach characterizes a program as a series of linear steps (that is, code).  In this model, programs are typically organized around code. This approach can be thought of as code acting on data.  Procedural languages such as C employ this model to considerable success.  In procedural programming, program is divided into small parts called functions.  Procedural programming follows top down approach.  In procedural programming, function is more important than data.
  • 10. Importance of OOP Why OOP (Process-Oriented Model)  In multi-function program, important data items are placed as global so that they may be accessed by all functions  Procedural programming is based on unreal world.
  • 11. Importance of OOP Why OOP (Drawbacks of Process-Oriented Model)  Problems with this approach appear as programs grow larger and more complex.  As function has complete access to the global variables, it is possible that new programmer can corrupt the data accidentally by creating functions.  Data is exposed to whole program, so no security for data.  In large program it is very difficult to identify what data is used by which function.  Difficult to relate with real world objects.  Difficult to create new data types reduces extensibility.  Importance is given to the operation on data rather that the data.
  • 12. Importance of OOP Why OOP (Object-Oriented Programming)  Object-oriented programming organizes a program around its data (that is, objects) and a set of well-defined interfaces to that data.  An object-oriented program can be characterized as data controlling access to code.  In OOP, problem is divided into the number of entities called objects and then builds data and methods around these objects.  It binds the data more closely to the method that operate on it and protects it from accidental modification.  Data of an object can be accessed only by the methods associated with the object.  Follows bottom up approach.  Increases code reusability and maintainability.
  • 13. Importance of OOP Why OOP is Important  Modularity for easier troubleshooting.  Reuse of code through inheritance.  Flexibility through polymorphism.  Effective problem solving.
  • 14. Java as OOP Language Why Java is Object Oriented  It is not possible to code in java without class and object. Even to write a single hello world program, we need to declare a class.  Java supports encapsulation.  Java supports abstraction.  Java supports inheritance.  Java supports polymorphism.
  • 15. JVM Architecture Introduction to JVM  JVM(Java Virtual Machine) acts as a run-time engine to run Java applications.  It converts Java bytecode into machines language  JVM is a part of JRE(Java Runtime Environment).
  • 16. JVM Architecture How JVM Works  In the Java programming language, all source code is first written in plain text files ending with the .java extension.  Those source files are then compiled into .class files by the javac compiler.  A .class file does not contain code that is native to your processor; it instead contains bytecodes—the machine language of the Java Virtual Machine (Java VM).  The java launcher tool then runs application with an instance of the Java Virtual Machine.
  • 17. JVM Architecture Why Java is Platform Independent  The meaning of platform-independent is that the java compiled code(byte code) can run on all operating systems.  The Java VM is available on many different operating systems.  As a result, the same .class files can run on Microsoft Windows, Linux, Mac OS and so on.
  • 18. Hello World Program Basic Hello World Program  Create a HelloWorld.java source file.  Write the following code in the source file.
  • 19. Hello World Program How to Execute Hello World Program  To compile HelloWorld.java, use the compiler. If successful, it will produce a file called HelloWorld.class in the same directory. > javac HelloWorld.java  To execute, run the Java VM and include the name of the class which contains the "main" method as the first command line parameter. > java HelloWorld
  • 20. Books 1. Java The Complete Reference- Ninth Edition by Herbert Schildt 2. Head First Java, By Kathy Sierra and Bert Bates