SlideShare a Scribd company logo
1 of 16
Download to read offline
12/5/19
Introducing Java OOP concepts
& solving OOP problems
Ivelin Yanev
12/5/19
OUTLINE
1.Object and class
2.Abstraction
3.Inheritance
4.Polymorphism
5.Encapsulation
2
12/5/19
What is Class?
A class is an entity that determines how an object will behave and what the
object will contain. In other words, it is a blueprint or a set of instruction to build a
specific type of object {exam_1}.
3
class <class_name>{
private field1;
public field2;
protected field3;
private method1() {
}
public method1() {
}
protected method1() {
}
}
Syntax Access modifiers
12/5/19
What is an Object?
An object is nothing but a self-contained component which consists of methods
and properties to make a particular type of data useful. Object determines the
behavior of the class{exam_2}.
4
student1
student2
Stack
name = Ivan
age=23
name = Nikola
age=34
Heap
12/5/19
Abstraction
Abstraction is the mechanism to hiding the unnecessary things from the users
and provide only functionality {exam_3}.
5
There is a two way to achieve Abstraction:
1. By Abstract Class  - Through “abstract” keyword, we can declare a class is abstract. The
abstract class cannot be instantiated.
2. By Interface  - In an interface, each method is public and abstract, but it does not contain
any constructor.
@An abstract method is a method that is declared without an implementation!
12/5/19
Abstraction
6
12/5/19
Inheritance
When properties of one class inherited by other class, this concept is known as
Inheritance. The concept of inheritance provides code reusability feature. When
a class inherits the properties is known as a child class whereas a class whose
properties are inherited is known as Parent class {exam_4}.
7
There are 4 different types of inheritance which is supported by Java:
1.Single Inheritance:
Class A
Class B
12/5/19
Inheritance
8
2. Multilevel Inheritance:
Class B
Class A
Class C
12/5/19
Inheritance
3. Hierarchical Inheritance
9
Class B
Class A
Class C
12/5/19
Inheritance
10
Class BClass A
Class C
4. Multiple Inheritance
Class B
12/5/19
Polymorphism
Polymorphism is the concept which has the ability of an object to take on many
forms. Polymorphism a concept by which we can perform a single action by with
different behaviors {exam_5}.
Polymorphism in Java is of two types:
1. Run time polymorphism (static binding or method overloading)
2. Compile time polymorphism (dynamic binding or method overriding)
11
12/5/19
Compile Time Polymorphism (static binding or method
overloading)
As the meaning is implicit, this is used to write the program in such a way, that
flow of control is decided in compile time itself. It is achieved using method
overloading. In method overloading, an object can have two or more methods
with same name, BUT, with their method parameters different. These
parameters may be different on two bases
12
public static double Math.max(double a, double b){..}
public static float Math.max(float a, float b){..}
public static int Math.max(int a, int b){..}
public static long Math.max(long a, long b){..}
12/5/19
Runtime Polymorphism (dynamic binding or method
overriding)
Method overriding is a feature which you get when you implement inheritance in
your program {exam_6}.
13
12/5/19
Runtime Polymorphism (dynamic binding or method
overriding)
14
a0 a1 a2
makeNoise() makeNoise() makeNoise()
makeNoise() makeNoise()
Copy of
Animal
Copy of
Animal
Animal object Cat object Dog object
The reference identity of an object can
be stored in any number of reference
variables.
12/5/19
Encapsulation
Encapsulation is a mechanism of binding code and data together in a single unit.
15
12/5/19
Questions
1. Make a class Car. Make several(at least 4) subtypes of Car, representing the different brands of
cars - Audi, BMW, Wolkswagen.
2. Make a class Time to hold information about the current time and the current date . Make an easy-
to-use constructor (from client perspective), that would represent the time and date the client
wants to hold in your class.
3. Create a friendly interactive calculator in java Bundle, execute and test your program as a jar file
4. Create a PhoneBook class that stores names and phone numbers and allows the operations of
look-up, insertion and deletion. For each new class that you've created above, create an interface
that defines its behavior, then require your class to implement it.
Bonus points: JavaDoc & good git practice
https://dev.liferay.com/en/participate/advanced-javadoc-guidelines
https://www.git-tower.com/learn/git/ebook/en/command-line/appendix/best-practices
16

More Related Content

What's hot

Design Pattern - Factory Method Pattern
Design Pattern - Factory Method PatternDesign Pattern - Factory Method Pattern
Design Pattern - Factory Method PatternMudasir Qazi
 
OWASP Secure Coding
OWASP Secure CodingOWASP Secure Coding
OWASP Secure Codingbilcorry
 
Java Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and ExampleJava Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and Examplekamal kotecha
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented ProgrammingIqra khalil
 
Java Interview Questions and Answers | Spring and Hibernate Interview Questio...
Java Interview Questions and Answers | Spring and Hibernate Interview Questio...Java Interview Questions and Answers | Spring and Hibernate Interview Questio...
Java Interview Questions and Answers | Spring and Hibernate Interview Questio...Edureka!
 
Security misconfiguration
Security misconfigurationSecurity misconfiguration
Security misconfigurationMicho Hayek
 
OWASP Top 10 2017 rc1 - The Ten Most Critical Web Application Security Risks
OWASP Top 10 2017 rc1 - The Ten Most Critical Web Application Security RisksOWASP Top 10 2017 rc1 - The Ten Most Critical Web Application Security Risks
OWASP Top 10 2017 rc1 - The Ten Most Critical Web Application Security RisksAndre Van Klaveren
 
Java Foundations: Objects and Classes
Java Foundations: Objects and ClassesJava Foundations: Objects and Classes
Java Foundations: Objects and ClassesSvetlin Nakov
 
A Guide to AWS Penetration Testing.pptx
A Guide to AWS Penetration Testing.pptxA Guide to AWS Penetration Testing.pptx
A Guide to AWS Penetration Testing.pptxsaurabhpandey251355
 
Lecture - 3 Variables-data type_operators_oops concept
Lecture - 3 Variables-data type_operators_oops conceptLecture - 3 Variables-data type_operators_oops concept
Lecture - 3 Variables-data type_operators_oops conceptmanish kumar
 
DDoS Attack Detection and Botnet Prevention using Machine Learning
DDoS Attack Detection and Botnet Prevention using Machine LearningDDoS Attack Detection and Botnet Prevention using Machine Learning
DDoS Attack Detection and Botnet Prevention using Machine LearningIRJET Journal
 
A5: Security Misconfiguration
A5: Security Misconfiguration A5: Security Misconfiguration
A5: Security Misconfiguration Tariq Islam
 
Information security and Attacks
Information security and AttacksInformation security and Attacks
Information security and AttacksSachin Darekar
 

What's hot (20)

Design Pattern - Factory Method Pattern
Design Pattern - Factory Method PatternDesign Pattern - Factory Method Pattern
Design Pattern - Factory Method Pattern
 
OWASP Secure Coding
OWASP Secure CodingOWASP Secure Coding
OWASP Secure Coding
 
Java packages
Java packagesJava packages
Java packages
 
Security testing
Security testingSecurity testing
Security testing
 
Security threats and attacks in cyber security
Security threats and attacks in cyber securitySecurity threats and attacks in cyber security
Security threats and attacks in cyber security
 
Java Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and ExampleJava Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and Example
 
Polymorphism in java
Polymorphism in javaPolymorphism in java
Polymorphism in java
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented Programming
 
Java Interview Questions and Answers | Spring and Hibernate Interview Questio...
Java Interview Questions and Answers | Spring and Hibernate Interview Questio...Java Interview Questions and Answers | Spring and Hibernate Interview Questio...
Java Interview Questions and Answers | Spring and Hibernate Interview Questio...
 
Firewall
FirewallFirewall
Firewall
 
Security misconfiguration
Security misconfigurationSecurity misconfiguration
Security misconfiguration
 
OWASP Top 10 2017 rc1 - The Ten Most Critical Web Application Security Risks
OWASP Top 10 2017 rc1 - The Ten Most Critical Web Application Security RisksOWASP Top 10 2017 rc1 - The Ten Most Critical Web Application Security Risks
OWASP Top 10 2017 rc1 - The Ten Most Critical Web Application Security Risks
 
Java Foundations: Objects and Classes
Java Foundations: Objects and ClassesJava Foundations: Objects and Classes
Java Foundations: Objects and Classes
 
A Guide to AWS Penetration Testing.pptx
A Guide to AWS Penetration Testing.pptxA Guide to AWS Penetration Testing.pptx
A Guide to AWS Penetration Testing.pptx
 
Lecture - 3 Variables-data type_operators_oops concept
Lecture - 3 Variables-data type_operators_oops conceptLecture - 3 Variables-data type_operators_oops concept
Lecture - 3 Variables-data type_operators_oops concept
 
DDoS Attack Detection and Botnet Prevention using Machine Learning
DDoS Attack Detection and Botnet Prevention using Machine LearningDDoS Attack Detection and Botnet Prevention using Machine Learning
DDoS Attack Detection and Botnet Prevention using Machine Learning
 
Java Spring
Java SpringJava Spring
Java Spring
 
A5: Security Misconfiguration
A5: Security Misconfiguration A5: Security Misconfiguration
A5: Security Misconfiguration
 
Information security and Attacks
Information security and AttacksInformation security and Attacks
Information security and Attacks
 
Who is BIRT
Who is BIRTWho is BIRT
Who is BIRT
 

Similar to Introducing java oop concepts

Core JAVA Training.ppt
Core JAVA Training.pptCore JAVA Training.ppt
Core JAVA Training.pptRadzT1
 
ITTutor Advanced Java (1).pptx
ITTutor Advanced Java (1).pptxITTutor Advanced Java (1).pptx
ITTutor Advanced Java (1).pptxkristinatemen
 
OOP in Java Presentation.pptx
OOP in Java Presentation.pptxOOP in Java Presentation.pptx
OOP in Java Presentation.pptxmrxyz19
 
Top 10 java oops interview questions
Top 10 java oops interview questionsTop 10 java oops interview questions
Top 10 java oops interview questionsnishajj
 
Top 10 java oops interview questions
Top 10 java oops interview questionsTop 10 java oops interview questions
Top 10 java oops interview questionsnishajj
 
Top 10 java_oops_interview_questions
Top 10 java_oops_interview_questionsTop 10 java_oops_interview_questions
Top 10 java_oops_interview_questionsnishajj
 
Top 10 java_oops_interview_questions
Top 10 java_oops_interview_questionsTop 10 java_oops_interview_questions
Top 10 java_oops_interview_questionsnishajj
 
Top 10 java_oops_interview_questions
Top 10 java_oops_interview_questionsTop 10 java_oops_interview_questions
Top 10 java_oops_interview_questionsnishajj
 
Top 10 java_oops_interview_questions
Top 10 java_oops_interview_questionsTop 10 java_oops_interview_questions
Top 10 java_oops_interview_questionsnishajj
 
Spring andspringboot training
Spring andspringboot trainingSpring andspringboot training
Spring andspringboot trainingMallikarjuna G D
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented ProgrammingSam Bramhecha
 
Object oriented vs. object based programming
Object oriented vs. object based  programmingObject oriented vs. object based  programming
Object oriented vs. object based programmingMohammad Kamrul Hasan
 
Principles of Object Oriented Programming
Principles of Object Oriented ProgrammingPrinciples of Object Oriented Programming
Principles of Object Oriented ProgrammingKasun Ranga Wijeweera
 
Java OOPS Concept
Java OOPS ConceptJava OOPS Concept
Java OOPS ConceptRicha Gupta
 
Java and its concepts
Java and its conceptsJava and its concepts
Java and its conceptsaashukaushik
 
Introduction to oop using java
Introduction  to oop using java Introduction  to oop using java
Introduction to oop using java omeed
 
Selenium Training .pptx
Selenium Training .pptxSelenium Training .pptx
Selenium Training .pptxSajidTk2
 

Similar to Introducing java oop concepts (20)

Core JAVA Training.ppt
Core JAVA Training.pptCore JAVA Training.ppt
Core JAVA Training.ppt
 
ITTutor Advanced Java (1).pptx
ITTutor Advanced Java (1).pptxITTutor Advanced Java (1).pptx
ITTutor Advanced Java (1).pptx
 
OOP in Java Presentation.pptx
OOP in Java Presentation.pptxOOP in Java Presentation.pptx
OOP in Java Presentation.pptx
 
Top 10 java oops interview questions
Top 10 java oops interview questionsTop 10 java oops interview questions
Top 10 java oops interview questions
 
Top 10 java oops interview questions
Top 10 java oops interview questionsTop 10 java oops interview questions
Top 10 java oops interview questions
 
Top 10 java_oops_interview_questions
Top 10 java_oops_interview_questionsTop 10 java_oops_interview_questions
Top 10 java_oops_interview_questions
 
Top 10 java_oops_interview_questions
Top 10 java_oops_interview_questionsTop 10 java_oops_interview_questions
Top 10 java_oops_interview_questions
 
Top 10 java_oops_interview_questions
Top 10 java_oops_interview_questionsTop 10 java_oops_interview_questions
Top 10 java_oops_interview_questions
 
Top 10 java_oops_interview_questions
Top 10 java_oops_interview_questionsTop 10 java_oops_interview_questions
Top 10 java_oops_interview_questions
 
Chapter 4
Chapter 4Chapter 4
Chapter 4
 
Spring andspringboot training
Spring andspringboot trainingSpring andspringboot training
Spring andspringboot training
 
Unit-V.pptx
Unit-V.pptxUnit-V.pptx
Unit-V.pptx
 
Inheritance
InheritanceInheritance
Inheritance
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented Programming
 
Object oriented vs. object based programming
Object oriented vs. object based  programmingObject oriented vs. object based  programming
Object oriented vs. object based programming
 
Principles of Object Oriented Programming
Principles of Object Oriented ProgrammingPrinciples of Object Oriented Programming
Principles of Object Oriented Programming
 
Java OOPS Concept
Java OOPS ConceptJava OOPS Concept
Java OOPS Concept
 
Java and its concepts
Java and its conceptsJava and its concepts
Java and its concepts
 
Introduction to oop using java
Introduction  to oop using java Introduction  to oop using java
Introduction to oop using java
 
Selenium Training .pptx
Selenium Training .pptxSelenium Training .pptx
Selenium Training .pptx
 

More from Ivelin Yanev

Quarkus Extensions Turbocharge for Java Microservices.pdf
Quarkus Extensions Turbocharge for Java Microservices.pdfQuarkus Extensions Turbocharge for Java Microservices.pdf
Quarkus Extensions Turbocharge for Java Microservices.pdfIvelin Yanev
 
Empowering Your Java Applications with Quarkus. A New Era of Fast, Efficient,...
Empowering Your Java Applications with Quarkus. A New Era of Fast, Efficient,...Empowering Your Java Applications with Quarkus. A New Era of Fast, Efficient,...
Empowering Your Java Applications with Quarkus. A New Era of Fast, Efficient,...Ivelin Yanev
 
Building flexible ETL pipelines with Apache Camel on Quarkus
Building flexible ETL pipelines with Apache Camel on QuarkusBuilding flexible ETL pipelines with Apache Camel on Quarkus
Building flexible ETL pipelines with Apache Camel on QuarkusIvelin Yanev
 
Introducing generic types
Introducing generic typesIntroducing generic types
Introducing generic typesIvelin Yanev
 
Java features. Java 8, 9, 10, 11
Java features. Java 8, 9, 10, 11Java features. Java 8, 9, 10, 11
Java features. Java 8, 9, 10, 11Ivelin Yanev
 
Java 9 modularity+
Java 9 modularity+Java 9 modularity+
Java 9 modularity+Ivelin Yanev
 
Intoduction Internet of Things
Intoduction Internet of ThingsIntoduction Internet of Things
Intoduction Internet of ThingsIvelin Yanev
 

More from Ivelin Yanev (11)

Quarkus Extensions Turbocharge for Java Microservices.pdf
Quarkus Extensions Turbocharge for Java Microservices.pdfQuarkus Extensions Turbocharge for Java Microservices.pdf
Quarkus Extensions Turbocharge for Java Microservices.pdf
 
Empowering Your Java Applications with Quarkus. A New Era of Fast, Efficient,...
Empowering Your Java Applications with Quarkus. A New Era of Fast, Efficient,...Empowering Your Java Applications with Quarkus. A New Era of Fast, Efficient,...
Empowering Your Java Applications with Quarkus. A New Era of Fast, Efficient,...
 
Project Loom
Project LoomProject Loom
Project Loom
 
Building flexible ETL pipelines with Apache Camel on Quarkus
Building flexible ETL pipelines with Apache Camel on QuarkusBuilding flexible ETL pipelines with Apache Camel on Quarkus
Building flexible ETL pipelines with Apache Camel on Quarkus
 
Git collaboration
Git collaborationGit collaboration
Git collaboration
 
Java exeptions
Java exeptionsJava exeptions
Java exeptions
 
Introducing generic types
Introducing generic typesIntroducing generic types
Introducing generic types
 
Java features. Java 8, 9, 10, 11
Java features. Java 8, 9, 10, 11Java features. Java 8, 9, 10, 11
Java features. Java 8, 9, 10, 11
 
Design principles
Design principlesDesign principles
Design principles
 
Java 9 modularity+
Java 9 modularity+Java 9 modularity+
Java 9 modularity+
 
Intoduction Internet of Things
Intoduction Internet of ThingsIntoduction Internet of Things
Intoduction Internet of Things
 

Recently uploaded

办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?Watsoo Telematics
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 

Recently uploaded (20)

办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 

Introducing java oop concepts

  • 1. 12/5/19 Introducing Java OOP concepts & solving OOP problems Ivelin Yanev
  • 3. 12/5/19 What is Class? A class is an entity that determines how an object will behave and what the object will contain. In other words, it is a blueprint or a set of instruction to build a specific type of object {exam_1}. 3 class <class_name>{ private field1; public field2; protected field3; private method1() { } public method1() { } protected method1() { } } Syntax Access modifiers
  • 4. 12/5/19 What is an Object? An object is nothing but a self-contained component which consists of methods and properties to make a particular type of data useful. Object determines the behavior of the class{exam_2}. 4 student1 student2 Stack name = Ivan age=23 name = Nikola age=34 Heap
  • 5. 12/5/19 Abstraction Abstraction is the mechanism to hiding the unnecessary things from the users and provide only functionality {exam_3}. 5 There is a two way to achieve Abstraction: 1. By Abstract Class  - Through “abstract” keyword, we can declare a class is abstract. The abstract class cannot be instantiated. 2. By Interface  - In an interface, each method is public and abstract, but it does not contain any constructor. @An abstract method is a method that is declared without an implementation!
  • 7. 12/5/19 Inheritance When properties of one class inherited by other class, this concept is known as Inheritance. The concept of inheritance provides code reusability feature. When a class inherits the properties is known as a child class whereas a class whose properties are inherited is known as Parent class {exam_4}. 7 There are 4 different types of inheritance which is supported by Java: 1.Single Inheritance: Class A Class B
  • 10. 12/5/19 Inheritance 10 Class BClass A Class C 4. Multiple Inheritance Class B
  • 11. 12/5/19 Polymorphism Polymorphism is the concept which has the ability of an object to take on many forms. Polymorphism a concept by which we can perform a single action by with different behaviors {exam_5}. Polymorphism in Java is of two types: 1. Run time polymorphism (static binding or method overloading) 2. Compile time polymorphism (dynamic binding or method overriding) 11
  • 12. 12/5/19 Compile Time Polymorphism (static binding or method overloading) As the meaning is implicit, this is used to write the program in such a way, that flow of control is decided in compile time itself. It is achieved using method overloading. In method overloading, an object can have two or more methods with same name, BUT, with their method parameters different. These parameters may be different on two bases 12 public static double Math.max(double a, double b){..} public static float Math.max(float a, float b){..} public static int Math.max(int a, int b){..} public static long Math.max(long a, long b){..}
  • 13. 12/5/19 Runtime Polymorphism (dynamic binding or method overriding) Method overriding is a feature which you get when you implement inheritance in your program {exam_6}. 13
  • 14. 12/5/19 Runtime Polymorphism (dynamic binding or method overriding) 14 a0 a1 a2 makeNoise() makeNoise() makeNoise() makeNoise() makeNoise() Copy of Animal Copy of Animal Animal object Cat object Dog object The reference identity of an object can be stored in any number of reference variables.
  • 15. 12/5/19 Encapsulation Encapsulation is a mechanism of binding code and data together in a single unit. 15
  • 16. 12/5/19 Questions 1. Make a class Car. Make several(at least 4) subtypes of Car, representing the different brands of cars - Audi, BMW, Wolkswagen. 2. Make a class Time to hold information about the current time and the current date . Make an easy- to-use constructor (from client perspective), that would represent the time and date the client wants to hold in your class. 3. Create a friendly interactive calculator in java Bundle, execute and test your program as a jar file 4. Create a PhoneBook class that stores names and phone numbers and allows the operations of look-up, insertion and deletion. For each new class that you've created above, create an interface that defines its behavior, then require your class to implement it. Bonus points: JavaDoc & good git practice https://dev.liferay.com/en/participate/advanced-javadoc-guidelines https://www.git-tower.com/learn/git/ebook/en/command-line/appendix/best-practices 16