SlideShare a Scribd company logo
1 of 25
Object Oriented
Technology

The

JAVA
Language
Jainul A. Musani
1
Programming Languages
•To adapt to
changing environments and
uses
•To implement
refinements and improvements
in the art of programming
Jainul A. Musani
2
History of OOPs


In 1960s Birth of Structured
Programming Language

 In early 1980s object-oriented
programming (OOP)
Jainul A. Musani
3
History of OOPs
 In

1979 C++ invented by
Bjarne Stroustrup

1980s and the early 1990s,
C++ took hold.
Jainul A. Musani
4
History of OOPs
 In

1991 Java was conceived
By James Gosling, Patrick
Naughton, Chris Warth,
Ed Frank, and Mike Sheridan

 At Sun Microsystems, Inc.

“Oak”  “Java” (1995)
Jainul A. Musani
5
Java the Language of
Internet

 Expanded the universe of objects
 Objects can move about freely
in cyberspace.
 On a network :
 passive information/data
 dynamic, active programs

Jainul A. Musani
6
Java Applications
-&- Java Applets

 An application is a program that runs

on your computer, under the operating
system of that computer.
 An applet is an application designed to
be transmitted over the Internet and
executed by a Java-compatible Web
browser.
Jainul A. Musani
7
Java’s Magic:
The Bytecode
 An application a highly optimized set
of instructions designed to be executed
by the Java run-time system - JVM
 JVM - Java Virtual Machine
 Truly Portable
Jainul A. Musani
8
JVM

 Interpreter
 JVM needs to be implemented for each
platform.

 Platform independent
 Bytecode enables the Java run-time
system to execute programs much faster
Jainul A. Musani
9
Just In Time
(JIT) compiler
 Sun supplies its Just In Time (JIT)
compiler for bytecode. (Java-2)
 JIT compiler is part of the JVM.
 It compiles bytecode into executable
code in real time, on a piece-by-piece,
demand basis.
Jainul A. Musani
10
Java Buzzwords
 Simple
 Secure
 Portable

 Architecture
Neutral
 Interpreted

 High
 Object-oriented performance
 Distributed
 Robust
 Multithreaded  Dynamic
Jainul A. Musani
11
Java Versions
 Java 1.0
 Java 1.1

 Java 2, ver.1.4
 Java 2, ver.1.5
 Java 2, ver.1.6

 Java 2
 Java 2, ver.1.2
 Java 2, ver.1.3

Jainul A. Musani
12
Java the OOP Language
 The Three OOP Principles
• Encapsulation
• Inheritance
• Polymorphism

 Abstraction
Jainul A. Musani
13
Encapsulation
A

getA( )

B

getB( )

Jainul A. Musani
14
Inheritance
Bird
Flying

Robin

Non-Flying

Swallow

Penguin

Kiwi

Jainul A. Musani
15
Polymorphism
Shape
Draw( )

Draw( a, b )

Draw( a )

Draw( a, b, c )

Rectangle

Circle

Triangle
Jainul A. Musani
16
• Run

time entity

Object

• Represent a
Person, Book,
Bank Account, etc…
• User defined data

Object : Student
DATA:
Roll_no
Name
Percentage
FUNCTIONS:
Total
Average
Display

• Example:
Jainul A. Musani
17
• Set

Class

of Data & Code is

class
•User defined data-type
• Example:
 Fruit,
 Furniture

CLASS
DATA:
:::::::::::::
:::::::::::::
FUNCTIONS:
::::::::::::
::::::::::::

 Vehicle
Jainul A. Musani
18
Variables & Data Types
• Named memory location that holds a

value
• In java variables must be declared before
it use in the program
• Variable must be of some datatype, it tells
compiler what type of value it can store
Jainul A. Musani
19
Data Types
• Java supports eight different basic data types.
Type

Size in

Character
Boolean
Byte
Short
Integer
Long
Float
Double

Bytes
2
1 bit
1
2
4
8
4
8

Description

Keyword

16 bit Unicode
char
1 – bit
boolean
8 – bits
byte
16 – bits
short
32 – bits
int
64 – bits
long
32 – bits
float
64 – bits
double
Jainul A. Musani
20
Declaration & Initialization of
variable
Datatype varName; // Declaration of Variable
varName = Value;
Example:
int count = 22;

Jainul A. Musani
21
Declaration & Initialization of
variable
float x, y, z;
// value here considers as ‘double’ type
x = 10.35;
x = 10.35f;
y = 24.56F;
z = y;
Jainul A. Musani
22
Declaration & Initialization of
variable
long m = 254836L;
System.out.println(“The value of m is “ + m);
Output:
The value of m is 254936

Jainul A. Musani
23
Declaration & Initialization of
variable
Character & Strings
char ch = ‘A’;
String s1= “This is Testing”;
//String is a class provide by Java.

Jainul A. Musani
24
Guess the Output

Class test
{
public static void main(String s[])
{
char c;
boolean flg;
int a;
System.out.println(c);
System.out.println(flg);
System.out.println(a);
}
Jainul A. Musani
}
25

More Related Content

Similar to Core Java Part-1 (20)

PROGRAMMING IN JAVA unit 1.pptx
PROGRAMMING IN JAVA unit 1.pptxPROGRAMMING IN JAVA unit 1.pptx
PROGRAMMING IN JAVA unit 1.pptx
 
what is java.pdf
what is java.pdfwhat is java.pdf
what is java.pdf
 
Java
JavaJava
Java
 
Java
JavaJava
Java
 
Java
JavaJava
Java
 
Java
JavaJava
Java
 
Java
JavaJava
Java
 
Java
JavaJava
Java
 
java ppt.pdf
java ppt.pdfjava ppt.pdf
java ppt.pdf
 
javapdf.pptx
javapdf.pptxjavapdf.pptx
javapdf.pptx
 
1 Introduction to JAVA.pptx
1 Introduction to JAVA.pptx1 Introduction to JAVA.pptx
1 Introduction to JAVA.pptx
 
Jill Robinson resume Apr 2017
Jill Robinson resume Apr 2017Jill Robinson resume Apr 2017
Jill Robinson resume Apr 2017
 
An Introduction to Recent Advances in the Field of NLP
An Introduction to Recent Advances in the Field of NLPAn Introduction to Recent Advances in the Field of NLP
An Introduction to Recent Advances in the Field of NLP
 
Java seminar
Java seminarJava seminar
Java seminar
 
VP7
VP7VP7
VP7
 
oop Lecture 7
oop Lecture 7oop Lecture 7
oop Lecture 7
 
Java history 01
Java history 01Java history 01
Java history 01
 
Presentation on java
Presentation on javaPresentation on java
Presentation on java
 
Chapter 1 (1).pptx
Chapter 1 (1).pptxChapter 1 (1).pptx
Chapter 1 (1).pptx
 
Artificial intelligence
Artificial intelligenceArtificial intelligence
Artificial intelligence
 

More from Jainul Musani

More from Jainul Musani (20)

React js t8 - inlinecss
React js   t8 - inlinecssReact js   t8 - inlinecss
React js t8 - inlinecss
 
React js t7 - forms-events
React js   t7 - forms-eventsReact js   t7 - forms-events
React js t7 - forms-events
 
React js t6 -lifecycle
React js   t6 -lifecycleReact js   t6 -lifecycle
React js t6 -lifecycle
 
React js t5 - state
React js   t5 - stateReact js   t5 - state
React js t5 - state
 
React js t4 - components
React js   t4 - componentsReact js   t4 - components
React js t4 - components
 
React js t3 - es6
React js   t3 - es6React js   t3 - es6
React js t3 - es6
 
React js t2 - jsx
React js   t2 - jsxReact js   t2 - jsx
React js t2 - jsx
 
React js t1 - introduction
React js   t1 - introductionReact js   t1 - introduction
React js t1 - introduction
 
ExpressJs Session01
ExpressJs Session01ExpressJs Session01
ExpressJs Session01
 
NodeJs Session03
NodeJs Session03NodeJs Session03
NodeJs Session03
 
NodeJs Session02
NodeJs Session02NodeJs Session02
NodeJs Session02
 
Nodejs Session01
Nodejs Session01Nodejs Session01
Nodejs Session01
 
Java exercise1
Java exercise1Java exercise1
Java exercise1
 
Fundamentals of JDBC
Fundamentals of JDBCFundamentals of JDBC
Fundamentals of JDBC
 
Core Java Special
Core Java SpecialCore Java Special
Core Java Special
 
Core Java Special
Core Java SpecialCore Java Special
Core Java Special
 
Cassandra-vs-MongoDB
Cassandra-vs-MongoDBCassandra-vs-MongoDB
Cassandra-vs-MongoDB
 
MongoDB-SESSION03
MongoDB-SESSION03MongoDB-SESSION03
MongoDB-SESSION03
 
MongoDB-SESSION02
MongoDB-SESSION02MongoDB-SESSION02
MongoDB-SESSION02
 
MongoDB-SESION01
MongoDB-SESION01MongoDB-SESION01
MongoDB-SESION01
 

Recently uploaded

CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 

Recently uploaded (20)

Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 

Core Java Part-1

  • 2. Programming Languages •To adapt to changing environments and uses •To implement refinements and improvements in the art of programming Jainul A. Musani 2
  • 3. History of OOPs  In 1960s Birth of Structured Programming Language  In early 1980s object-oriented programming (OOP) Jainul A. Musani 3
  • 4. History of OOPs  In 1979 C++ invented by Bjarne Stroustrup 1980s and the early 1990s, C++ took hold. Jainul A. Musani 4
  • 5. History of OOPs  In 1991 Java was conceived By James Gosling, Patrick Naughton, Chris Warth, Ed Frank, and Mike Sheridan  At Sun Microsystems, Inc. “Oak”  “Java” (1995) Jainul A. Musani 5
  • 6. Java the Language of Internet  Expanded the universe of objects  Objects can move about freely in cyberspace.  On a network :  passive information/data  dynamic, active programs Jainul A. Musani 6
  • 7. Java Applications -&- Java Applets  An application is a program that runs on your computer, under the operating system of that computer.  An applet is an application designed to be transmitted over the Internet and executed by a Java-compatible Web browser. Jainul A. Musani 7
  • 8. Java’s Magic: The Bytecode  An application a highly optimized set of instructions designed to be executed by the Java run-time system - JVM  JVM - Java Virtual Machine  Truly Portable Jainul A. Musani 8
  • 9. JVM  Interpreter  JVM needs to be implemented for each platform.  Platform independent  Bytecode enables the Java run-time system to execute programs much faster Jainul A. Musani 9
  • 10. Just In Time (JIT) compiler  Sun supplies its Just In Time (JIT) compiler for bytecode. (Java-2)  JIT compiler is part of the JVM.  It compiles bytecode into executable code in real time, on a piece-by-piece, demand basis. Jainul A. Musani 10
  • 11. Java Buzzwords  Simple  Secure  Portable  Architecture Neutral  Interpreted  High  Object-oriented performance  Distributed  Robust  Multithreaded  Dynamic Jainul A. Musani 11
  • 12. Java Versions  Java 1.0  Java 1.1  Java 2, ver.1.4  Java 2, ver.1.5  Java 2, ver.1.6  Java 2  Java 2, ver.1.2  Java 2, ver.1.3 Jainul A. Musani 12
  • 13. Java the OOP Language  The Three OOP Principles • Encapsulation • Inheritance • Polymorphism  Abstraction Jainul A. Musani 13
  • 16. Polymorphism Shape Draw( ) Draw( a, b ) Draw( a ) Draw( a, b, c ) Rectangle Circle Triangle Jainul A. Musani 16
  • 17. • Run time entity Object • Represent a Person, Book, Bank Account, etc… • User defined data Object : Student DATA: Roll_no Name Percentage FUNCTIONS: Total Average Display • Example: Jainul A. Musani 17
  • 18. • Set Class of Data & Code is class •User defined data-type • Example:  Fruit,  Furniture CLASS DATA: ::::::::::::: ::::::::::::: FUNCTIONS: :::::::::::: ::::::::::::  Vehicle Jainul A. Musani 18
  • 19. Variables & Data Types • Named memory location that holds a value • In java variables must be declared before it use in the program • Variable must be of some datatype, it tells compiler what type of value it can store Jainul A. Musani 19
  • 20. Data Types • Java supports eight different basic data types. Type Size in Character Boolean Byte Short Integer Long Float Double Bytes 2 1 bit 1 2 4 8 4 8 Description Keyword 16 bit Unicode char 1 – bit boolean 8 – bits byte 16 – bits short 32 – bits int 64 – bits long 32 – bits float 64 – bits double Jainul A. Musani 20
  • 21. Declaration & Initialization of variable Datatype varName; // Declaration of Variable varName = Value; Example: int count = 22; Jainul A. Musani 21
  • 22. Declaration & Initialization of variable float x, y, z; // value here considers as ‘double’ type x = 10.35; x = 10.35f; y = 24.56F; z = y; Jainul A. Musani 22
  • 23. Declaration & Initialization of variable long m = 254836L; System.out.println(“The value of m is “ + m); Output: The value of m is 254936 Jainul A. Musani 23
  • 24. Declaration & Initialization of variable Character & Strings char ch = ‘A’; String s1= “This is Testing”; //String is a class provide by Java. Jainul A. Musani 24
  • 25. Guess the Output Class test { public static void main(String s[]) { char c; boolean flg; int a; System.out.println(c); System.out.println(flg); System.out.println(a); } Jainul A. Musani } 25