SlideShare a Scribd company logo
1 of 49
PRESENTED BY:
FARHANA THASNIM.M
HAJIRA BEE.A
MUhsINA PARVEEN .N.A
AQMAL BEGUM.S
OBJECTIVES:
 BASIC OF PROGRAMMING LANGUAGE.
 WHAT IS OOPS?
 JAVA OVERVIEW(HISTORY,FEATURES).
 OOPS CONCEPT IN JAVA.
 JAVA COMPARE WITH C++.
 EXAMPLE PROGRAMS OF JAVA AND C++.
WHAT IS OBJECT ORIENTED PROGRAMMING?
Object oriented
programming is a computer
programming model that organize
software design around data, or
object ,rather then functions and
logic . An object can be defined
as a data field that has unique
attributes and behavior.
PROGRAMMING LANGUAGE:
It is a formal computer language which is
designed to communicate
instruction or commands or orders
to a machine , particularly a
computer programming
languages can be used to create
programs to control behaviour of
the machine.
What is java?
Java is an object-oriented,
cross-platform programming
language introduced
in 1995 by Sun
Microsystems .
Today , Java helps run
many applications ,
including Sport ,
Social Media ,
Audio , Video , etc,…
JAVA FEATURES:
Object oriented Programming (oop)
is a computer programming model
that organizes software Design
around data , or objects , rather than
functions and logic. An Object can
be defined as a data field that has
unique attributes and behaviour.
What is OOP(Object Oriented Programming)?
CLASS :
A class is a group of
objects that share common
properties and behaviour .
You can also think of a
class as a blueprint from
which you can create
an individual object.
keyword : class
Example of class:
Class Bicycle
{
Private int gear=5;
Public void braking()
{
System.out.println(“Working of braking:”);
}
}
REAL TIME EXAMPLE:
object:
In the java programming language ,
an object is an instance of
a java class ,meaning it’s a
copy of a specific class .
Java objects have three
primary characteristics:
identity , state and behavior.
EXAMPLE OF OBJECT:
Create an object called "myObj" and print the value of
x:
public class Main
{
int x = 5;
public static void main(String[] args)
{
Main myObj = new Main();
System.out.println(myObj.x);
}
}
Inheritance:
The process of obtaining the
data members four methods
from one class to another
class is known as
inheritance .
It’s one of the fundamental
features of oops .
Real time example in inheritance:
Example of inheritance:
Class Employee
{
Float salary=40000;
}
Class programmer extends Employee
{
int bonus= 10000;
Public static void main(String [] args)
{
Programmer P =new programmer();
System.out.println(“programmer salary is :”+p.salary);
System.out.println(”Bonus of programmer is :”+p.bonus);
}
}
Abstraction means hiding
Lower-level
details and Exposing
only those essential
And relevant details
to the users .
Abstraction:
Example of Abstract class that has an abstract method
abstract class Bike
{
abstract void run();
}
class Honda4 extends Bike
{
void run(){System.out.println("running safely");}
public static void main(String args[])
{
Bike obj = new Honda4();
obj.run();
}
}
ENCAPSULATION:
Encapsulation is a process of
wrapping data and method in a single
unit is called encapsulation .
In oops , data and methods operating
on that data are combined together to
form a single unit , which is referred
to as a class .
It is the mechanism that binds
together code and the data it
manipulates and keeps both safes
form outside interface and misuse .
in real time example:
Example of Encapsulation in Java:
package com.javatpoint;
class student
{
public static void main(String[] args)
{
Student s=new Student();
s.setName("vijay");
System.out.println(s.getName());
}
}
Polymorphism:
 The process of representing one form in
multiple form is known as polymorphism
.
 It is allows us to perform a single
action in different way.
 It is allows you to define one interface
and have multiple implementation.
 Polymorphism means many form .
Example of Java Runtime Polymorphism:
class Bike
{
void run(){System.out.println("running");
}
}
class Splendor extends Bike
{
void run(){System.out.println("running safely with 60km");
}
public static void main(String []args)
{
Bike b = new Splendor();
b.run();
}
}
S.NO PARAMETERS JAVA C++
1. Portability It can run on any OS
hence it is portable.
C++ is platform
dependent hence it is not
portable.
2. compilation Java is both compiled
and interpreted language.
C++ is a compiled
language.
3. Memory Management is
System Controlled.
Memory Management in
C++ is Manual.
4. Virtual Keyword It doesn’t have a Virtual
Keyword.
It has Virtual keywords.
5. Multiple Inheritance It supports only single
inheritance. Multiple
inheritances are achieved
partially using interfaces.
It supports both single
and multiple Inheritance.
6. Overloading It supports only method
overloading and doesn’t
allow operator
It supports both method
and operator
overloading.
Memory
Management
7. Pointers It has limited support for
pointers.
It strongly supports
pointers.
8. Libraries Libraries have a wide range
of classes for various high-
level services.
C++ libraries have
comparatively low-level
functionalities.
9. Documentation
Comment
It supports documentation
comments (e.g., /**.. */) for
source code.
It doesn’t support
documentation comments
for source code.
10.
Thread
Support
Java provides built-in support
for multithreading.
C++ doesn’t have built-in
support for threads,
depends on third-party
threading libraries.
11.
Type
Java is only an object-
oriented programming
language.
C++ is both a procedural
and an object-oriented
programming language.
12. Input-Output
mechanism
Java uses the (System
class): System.in for input
C++ uses cin for input
and cout for an output
APPLICATIONS OF JAVA PROGRAMMING LANGUAGE:
 Desktop GUI Applications development.
 Android and Mobile application development.
 Application of java are in embedded
technologies lie SIM cards , disk players , TV ,
etc,..
 Java EE(Enterprise Edition) provides an API and
runtime environment for running large enterprise
software.
 Network Applications and Web services like
Internet connection , Web App Development.
SYNTAX OF JAVA :
import java.io.*;
class GFG
{
public static void main (String[] args)
{
System.out.println("GFG!");
}
}
EXAMPLE OF JAVA PROGRAM:
Import java.io.*;
Class person
{
String name;
int age;
Person (int age, string name)
{
this.name = name;
this.age=age;
}
}
Class Employee extends person
{
int emp _ id;
int emp _ salary;
Employee( int id, String name, int age , int salary)
{
Super(age , name);
emp_id=id;
emp_salary=salary;
}
System.out.println(“Employee ID:”+emp_id);
System.out.println(“Employee name:”+name);
System.out.println(“Employee age:”+age);
System.out.println(“Employee salary:”+emp_salary);
}
}
Public class main
{
Public static void main(string[]args)
{
Employee emp=new
Employee(101,”SAMANTHA”,20,60000);
emp.printEmployeeDetails();
}
}
OUTPUT:

More Related Content

Similar to object oriented programming concept in java.pptx

A CASE STUDY JAVA IS SECURE PROGRAMMING LANGUAGE
A CASE STUDY  JAVA IS SECURE PROGRAMMING LANGUAGEA CASE STUDY  JAVA IS SECURE PROGRAMMING LANGUAGE
A CASE STUDY JAVA IS SECURE PROGRAMMING LANGUAGENathan Mathis
 
Object Oriented Programming All Unit Notes
Object Oriented Programming All Unit NotesObject Oriented Programming All Unit Notes
Object Oriented Programming All Unit NotesBalamuruganV28
 
What is java?-Saurabh Upadhyay
What is java?-Saurabh UpadhyayWhat is java?-Saurabh Upadhyay
What is java?-Saurabh UpadhyaySaurabh Upadhyay
 
Elements of Java Language
Elements of Java Language Elements of Java Language
Elements of Java Language Hitesh-Java
 
Unit1 introduction to Java
Unit1 introduction to JavaUnit1 introduction to Java
Unit1 introduction to JavaDevaKumari Vijay
 
ITTutor Advanced Java (1).pptx
ITTutor Advanced Java (1).pptxITTutor Advanced Java (1).pptx
ITTutor Advanced Java (1).pptxkristinatemen
 
Java programming material for beginners by Nithin, VVCE, Mysuru
Java programming material for beginners by Nithin, VVCE, MysuruJava programming material for beginners by Nithin, VVCE, Mysuru
Java programming material for beginners by Nithin, VVCE, MysuruNithin Kumar,VVCE, Mysuru
 
Summer training presentation on "CORE JAVA".
Summer training presentation on "CORE JAVA".Summer training presentation on "CORE JAVA".
Summer training presentation on "CORE JAVA".SudhanshuVijay3
 
Interoduction to c++
Interoduction to c++Interoduction to c++
Interoduction to c++Amresh Raj
 
Introduction to Java Programming.pdf
Introduction to Java Programming.pdfIntroduction to Java Programming.pdf
Introduction to Java Programming.pdfAdiseshaK
 
Evolution Of Object Oriented Technology
Evolution Of Object Oriented TechnologyEvolution Of Object Oriented Technology
Evolution Of Object Oriented TechnologySharon Roberts
 
mohseen.pptx full stack development report internship
mohseen.pptx full stack development report internshipmohseen.pptx full stack development report internship
mohseen.pptx full stack development report internshipmaheshsiyatalab
 
Session 02 - Elements of Java Language
Session 02 - Elements of Java LanguageSession 02 - Elements of Java Language
Session 02 - Elements of Java LanguagePawanMM
 
JAVA PROGRAMMING-Unit I - Final PPT.pptx
JAVA PROGRAMMING-Unit I - Final PPT.pptxJAVA PROGRAMMING-Unit I - Final PPT.pptx
JAVA PROGRAMMING-Unit I - Final PPT.pptxSuganthiDPSGRKCW
 

Similar to object oriented programming concept in java.pptx (20)

Core java part1
Core java  part1Core java  part1
Core java part1
 
Basics-Of-Java
Basics-Of-JavaBasics-Of-Java
Basics-Of-Java
 
A CASE STUDY JAVA IS SECURE PROGRAMMING LANGUAGE
A CASE STUDY  JAVA IS SECURE PROGRAMMING LANGUAGEA CASE STUDY  JAVA IS SECURE PROGRAMMING LANGUAGE
A CASE STUDY JAVA IS SECURE PROGRAMMING LANGUAGE
 
Object Oriented Programming All Unit Notes
Object Oriented Programming All Unit NotesObject Oriented Programming All Unit Notes
Object Oriented Programming All Unit Notes
 
What is java?-Saurabh Upadhyay
What is java?-Saurabh UpadhyayWhat is java?-Saurabh Upadhyay
What is java?-Saurabh Upadhyay
 
Unit-IV_Introduction to Java.pdf
Unit-IV_Introduction to Java.pdfUnit-IV_Introduction to Java.pdf
Unit-IV_Introduction to Java.pdf
 
Elements of Java Language
Elements of Java Language Elements of Java Language
Elements of Java Language
 
Unit1 introduction to Java
Unit1 introduction to JavaUnit1 introduction to Java
Unit1 introduction to Java
 
Java 3 rd sem. 2012 aug.ASSIGNMENT
Java 3 rd sem. 2012 aug.ASSIGNMENTJava 3 rd sem. 2012 aug.ASSIGNMENT
Java 3 rd sem. 2012 aug.ASSIGNMENT
 
ITTutor Advanced Java (1).pptx
ITTutor Advanced Java (1).pptxITTutor Advanced Java (1).pptx
ITTutor Advanced Java (1).pptx
 
Java programming material for beginners by Nithin, VVCE, Mysuru
Java programming material for beginners by Nithin, VVCE, MysuruJava programming material for beginners by Nithin, VVCE, Mysuru
Java programming material for beginners by Nithin, VVCE, Mysuru
 
Summer training presentation on "CORE JAVA".
Summer training presentation on "CORE JAVA".Summer training presentation on "CORE JAVA".
Summer training presentation on "CORE JAVA".
 
Interoduction to c++
Interoduction to c++Interoduction to c++
Interoduction to c++
 
java slides
java slidesjava slides
java slides
 
Introduction to Java Programming.pdf
Introduction to Java Programming.pdfIntroduction to Java Programming.pdf
Introduction to Java Programming.pdf
 
Evolution Of Object Oriented Technology
Evolution Of Object Oriented TechnologyEvolution Of Object Oriented Technology
Evolution Of Object Oriented Technology
 
mohseen.pptx full stack development report internship
mohseen.pptx full stack development report internshipmohseen.pptx full stack development report internship
mohseen.pptx full stack development report internship
 
Session 02 - Elements of Java Language
Session 02 - Elements of Java LanguageSession 02 - Elements of Java Language
Session 02 - Elements of Java Language
 
JAVA PROGRAMMING-Unit I - Final PPT.pptx
JAVA PROGRAMMING-Unit I - Final PPT.pptxJAVA PROGRAMMING-Unit I - Final PPT.pptx
JAVA PROGRAMMING-Unit I - Final PPT.pptx
 
Java_presesntation.ppt
Java_presesntation.pptJava_presesntation.ppt
Java_presesntation.ppt
 

Recently uploaded

Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
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
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
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
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
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
 
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
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 

Recently uploaded (20)

Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
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
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
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
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
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
 
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
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 

object oriented programming concept in java.pptx

  • 1.
  • 2. PRESENTED BY: FARHANA THASNIM.M HAJIRA BEE.A MUhsINA PARVEEN .N.A AQMAL BEGUM.S
  • 3.
  • 4. OBJECTIVES:  BASIC OF PROGRAMMING LANGUAGE.  WHAT IS OOPS?  JAVA OVERVIEW(HISTORY,FEATURES).  OOPS CONCEPT IN JAVA.  JAVA COMPARE WITH C++.  EXAMPLE PROGRAMS OF JAVA AND C++.
  • 5. WHAT IS OBJECT ORIENTED PROGRAMMING? Object oriented programming is a computer programming model that organize software design around data, or object ,rather then functions and logic . An object can be defined as a data field that has unique attributes and behavior.
  • 6.
  • 7. PROGRAMMING LANGUAGE: It is a formal computer language which is designed to communicate instruction or commands or orders to a machine , particularly a computer programming languages can be used to create programs to control behaviour of the machine.
  • 8.
  • 9.
  • 10. What is java? Java is an object-oriented, cross-platform programming language introduced in 1995 by Sun Microsystems . Today , Java helps run many applications , including Sport , Social Media , Audio , Video , etc,…
  • 11.
  • 13. Object oriented Programming (oop) is a computer programming model that organizes software Design around data , or objects , rather than functions and logic. An Object can be defined as a data field that has unique attributes and behaviour. What is OOP(Object Oriented Programming)?
  • 14.
  • 15.
  • 16.
  • 17. CLASS : A class is a group of objects that share common properties and behaviour . You can also think of a class as a blueprint from which you can create an individual object. keyword : class
  • 18. Example of class: Class Bicycle { Private int gear=5; Public void braking() { System.out.println(“Working of braking:”); } }
  • 20.
  • 21. object: In the java programming language , an object is an instance of a java class ,meaning it’s a copy of a specific class . Java objects have three primary characteristics: identity , state and behavior.
  • 22. EXAMPLE OF OBJECT: Create an object called "myObj" and print the value of x: public class Main { int x = 5; public static void main(String[] args) { Main myObj = new Main(); System.out.println(myObj.x); } }
  • 23.
  • 24.
  • 25. Inheritance: The process of obtaining the data members four methods from one class to another class is known as inheritance . It’s one of the fundamental features of oops .
  • 26. Real time example in inheritance:
  • 27. Example of inheritance: Class Employee { Float salary=40000; } Class programmer extends Employee { int bonus= 10000; Public static void main(String [] args) { Programmer P =new programmer(); System.out.println(“programmer salary is :”+p.salary); System.out.println(”Bonus of programmer is :”+p.bonus); } }
  • 28.
  • 29. Abstraction means hiding Lower-level details and Exposing only those essential And relevant details to the users . Abstraction:
  • 30.
  • 31. Example of Abstract class that has an abstract method abstract class Bike { abstract void run(); } class Honda4 extends Bike { void run(){System.out.println("running safely");} public static void main(String args[]) { Bike obj = new Honda4(); obj.run(); } }
  • 32.
  • 33. ENCAPSULATION: Encapsulation is a process of wrapping data and method in a single unit is called encapsulation . In oops , data and methods operating on that data are combined together to form a single unit , which is referred to as a class . It is the mechanism that binds together code and the data it manipulates and keeps both safes form outside interface and misuse .
  • 34. in real time example:
  • 35. Example of Encapsulation in Java: package com.javatpoint; class student { public static void main(String[] args) { Student s=new Student(); s.setName("vijay"); System.out.println(s.getName()); } }
  • 36.
  • 37. Polymorphism:  The process of representing one form in multiple form is known as polymorphism .  It is allows us to perform a single action in different way.  It is allows you to define one interface and have multiple implementation.  Polymorphism means many form .
  • 38.
  • 39. Example of Java Runtime Polymorphism: class Bike { void run(){System.out.println("running"); } } class Splendor extends Bike { void run(){System.out.println("running safely with 60km"); } public static void main(String []args) { Bike b = new Splendor(); b.run(); } }
  • 40.
  • 41. S.NO PARAMETERS JAVA C++ 1. Portability It can run on any OS hence it is portable. C++ is platform dependent hence it is not portable. 2. compilation Java is both compiled and interpreted language. C++ is a compiled language. 3. Memory Management is System Controlled. Memory Management in C++ is Manual. 4. Virtual Keyword It doesn’t have a Virtual Keyword. It has Virtual keywords. 5. Multiple Inheritance It supports only single inheritance. Multiple inheritances are achieved partially using interfaces. It supports both single and multiple Inheritance. 6. Overloading It supports only method overloading and doesn’t allow operator It supports both method and operator overloading. Memory Management
  • 42. 7. Pointers It has limited support for pointers. It strongly supports pointers. 8. Libraries Libraries have a wide range of classes for various high- level services. C++ libraries have comparatively low-level functionalities. 9. Documentation Comment It supports documentation comments (e.g., /**.. */) for source code. It doesn’t support documentation comments for source code. 10. Thread Support Java provides built-in support for multithreading. C++ doesn’t have built-in support for threads, depends on third-party threading libraries. 11. Type Java is only an object- oriented programming language. C++ is both a procedural and an object-oriented programming language. 12. Input-Output mechanism Java uses the (System class): System.in for input C++ uses cin for input and cout for an output
  • 43. APPLICATIONS OF JAVA PROGRAMMING LANGUAGE:  Desktop GUI Applications development.  Android and Mobile application development.  Application of java are in embedded technologies lie SIM cards , disk players , TV , etc,..  Java EE(Enterprise Edition) provides an API and runtime environment for running large enterprise software.  Network Applications and Web services like Internet connection , Web App Development.
  • 44.
  • 45. SYNTAX OF JAVA : import java.io.*; class GFG { public static void main (String[] args) { System.out.println("GFG!"); } }
  • 46.
  • 47. EXAMPLE OF JAVA PROGRAM: Import java.io.*; Class person { String name; int age; Person (int age, string name) { this.name = name; this.age=age; } } Class Employee extends person {
  • 48. int emp _ id; int emp _ salary; Employee( int id, String name, int age , int salary) { Super(age , name); emp_id=id; emp_salary=salary; } System.out.println(“Employee ID:”+emp_id); System.out.println(“Employee name:”+name); System.out.println(“Employee age:”+age); System.out.println(“Employee salary:”+emp_salary); } } Public class main { Public static void main(string[]args)