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

Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonJericReyAuditor
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
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
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
“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
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 

Recently uploaded (20)

Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lesson
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
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
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
“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...
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
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
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 

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