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

2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 

Recently uploaded (20)

2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 

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