• Java Arrays
  • Java Strings
  • Java Collection
  • Java 8 Tutorial
  • Java Multithreading
  • Java Exception Handling
  • Java Programs
  • Java Project
  • Java Collections Interview
  • Java Interview Questions
  • Spring Boot
  • Java Tutorial

Overview of Java

  • Introduction to Java
  • The Complete History of Java Programming Language
  • C++ vs Java vs Python
  • How to Download and Install Java for 64 bit machine?
  • Setting up the environment in Java
  • How to Download and Install Eclipse on Windows?
  • JDK in Java
  • How JVM Works - JVM Architecture?
  • Differences between JDK, JRE and JVM
  • Just In Time Compiler
  • Difference between JIT and JVM in Java
  • Difference between Byte Code and Machine Code
  • How is Java platform independent?

Basics of Java

  • Java Basic Syntax
  • Java Hello World Program
  • Java Data Types
  • Primitive data type vs. Object data type in Java with Examples
  • Java Identifiers

Operators in Java

  • Java Variables
  • Scope of Variables In Java

Wrapper Classes in Java

Input/output in java.

  • How to Take Input From User in Java?
  • Scanner Class in Java
  • Java.io.BufferedReader Class in Java
  • Difference Between Scanner and BufferedReader Class in Java
  • Ways to read input from console in Java
  • System.out.println in Java
  • Difference between print() and println() in Java
  • Formatted Output in Java using printf()
  • Fast I/O in Java in Competitive Programming

Flow Control in Java

  • Decision Making in Java (if, if-else, switch, break, continue, jump)
  • Java if statement with Examples
  • Java if-else
  • Java if-else-if ladder with Examples
  • Loops in Java
  • For Loop in Java
  • Java while loop with Examples
  • Java do-while loop with Examples
  • For-each loop in Java
  • Continue Statement in Java
  • Break statement in Java
  • Usage of Break keyword in Java
  • return keyword in Java
  • Java Arithmetic Operators with Examples
  • Java Unary Operator with Examples
  • Java Assignment Operators with Examples
  • Java Relational Operators with Examples
  • Java Logical Operators with Examples
  • Java Ternary Operator with Examples
  • Bitwise Operators in Java
  • Strings in Java
  • String class in Java
  • Java.lang.String class in Java | Set 2
  • Why Java Strings are Immutable?
  • StringBuffer class in Java
  • StringBuilder Class in Java with Examples
  • String vs StringBuilder vs StringBuffer in Java
  • StringTokenizer Class in Java
  • StringTokenizer Methods in Java with Examples | Set 2
  • StringJoiner Class in Java
  • Arrays in Java
  • Arrays class in Java
  • Multidimensional Arrays in Java
  • Different Ways To Declare And Initialize 2-D Array in Java
  • Jagged Array in Java
  • Final Arrays in Java
  • Reflection Array Class in Java
  • util.Arrays vs reflect.Array in Java with Examples

OOPS in Java

  • Object Oriented Programming (OOPs) Concept in Java
  • Why Java is not a purely Object-Oriented Language?
  • Classes and Objects in Java
  • Naming Conventions in Java
  • Java Methods

Access Modifiers in Java

  • Java Constructors
  • Four Main Object Oriented Programming Concepts of Java

Inheritance in Java

Abstraction in java, encapsulation in java, polymorphism in java, interfaces in java.

  • 'this' reference in Java
  • Inheritance and Constructors in Java
  • Java and Multiple Inheritance
  • Interfaces and Inheritance in Java
  • Association, Composition and Aggregation in Java
  • Comparison of Inheritance in C++ and Java
  • abstract keyword in java
  • Abstract Class in Java
  • Difference between Abstract Class and Interface in Java
  • Control Abstraction in Java with Examples
  • Difference Between Data Hiding and Abstraction in Java
  • Difference between Abstraction and Encapsulation in Java with Examples
  • Difference between Inheritance and Polymorphism
  • Dynamic Method Dispatch or Runtime Polymorphism in Java
  • Difference between Compile-time and Run-time Polymorphism in Java

Constructors in Java

  • Copy Constructor in Java
  • Constructor Overloading in Java
  • Constructor Chaining In Java with Examples
  • Private Constructors and Singleton Classes in Java

Methods in Java

  • Static methods vs Instance methods in Java
  • Abstract Method in Java with Examples
  • Overriding in Java
  • Method Overloading in Java
  • Difference Between Method Overloading and Method Overriding in Java
  • Differences between Interface and Class in Java
  • Functional Interfaces in Java
  • Nested Interface in Java
  • Marker interface in Java
  • Comparator Interface in Java with Examples
  • Need of Wrapper Classes in Java
  • Different Ways to Create the Instances of Wrapper Classes in Java
  • Character Class in Java
  • Java.Lang.Byte class in Java
  • Java.Lang.Short class in Java
  • Java.lang.Integer class in Java
  • Java.Lang.Long class in Java
  • Java.Lang.Float class in Java
  • Java.Lang.Double Class in Java
  • Java.lang.Boolean Class in Java
  • Autoboxing and Unboxing in Java
  • Type conversion in Java with Examples

Keywords in Java

  • Java Keywords
  • Important Keywords in Java
  • Super Keyword in Java
  • final Keyword in Java
  • static Keyword in Java
  • enum in Java
  • transient keyword in Java
  • volatile Keyword in Java
  • final, finally and finalize in Java
  • Public vs Protected vs Package vs Private Access Modifier in Java
  • Access and Non Access Modifiers in Java

Memory Allocation in Java

  • Java Memory Management
  • How are Java objects stored in memory?
  • Stack vs Heap Memory Allocation
  • How many types of memory areas are allocated by JVM?
  • Garbage Collection in Java
  • Types of JVM Garbage Collectors in Java with implementation details
  • Memory leaks in Java
  • Java Virtual Machine (JVM) Stack Area

Classes of Java

  • Understanding Classes and Objects in Java
  • Singleton Method Design Pattern in Java
  • Object Class in Java
  • Inner Class in Java
  • Throwable Class in Java with Examples

Packages in Java

  • Packages In Java
  • How to Create a Package in Java?
  • Java.util Package in Java
  • Java.lang package in Java
  • Java.io Package in Java
  • Java Collection Tutorial

Exception Handling in Java

  • Exceptions in Java
  • Types of Exception in Java with Examples
  • Checked vs Unchecked Exceptions in Java
  • Java Try Catch Block
  • Flow control in try catch finally in Java
  • throw and throws in Java
  • User-defined Custom Exception in Java
  • Chained Exceptions in Java
  • Null Pointer Exception In Java
  • Exception Handling with Method Overriding in Java
  • Multithreading in Java
  • Lifecycle and States of a Thread in Java
  • Java Thread Priority in Multithreading
  • Main thread in Java
  • Java.lang.Thread Class in Java
  • Runnable interface in Java
  • Naming a thread and fetching name of current thread in Java
  • What does start() function do in multithreading in Java?
  • Difference between Thread.start() and Thread.run() in Java
  • Thread.sleep() Method in Java With Examples
  • Synchronization in Java
  • Importance of Thread Synchronization in Java
  • Method and Block Synchronization in Java
  • Lock framework vs Thread synchronization in Java
  • Difference Between Atomic, Volatile and Synchronized in Java
  • Deadlock in Java Multithreading
  • Deadlock Prevention And Avoidance
  • Difference Between Lock and Monitor in Java Concurrency
  • Reentrant Lock in Java

File Handling in Java

  • Java.io.File Class in Java
  • Java Program to Create a New File
  • Different ways of Reading a text file in Java
  • Java Program to Write into a File
  • Delete a File Using Java
  • File Permissions in Java
  • FileWriter Class in Java
  • Java.io.FileDescriptor in Java
  • Java.io.RandomAccessFile Class Method | Set 1
  • Regular Expressions in Java
  • Regex Tutorial - How to write Regular Expressions?
  • Matcher pattern() method in Java with Examples
  • Pattern pattern() method in Java with Examples
  • Quantifiers in Java
  • java.lang.Character class methods | Set 1
  • Java IO : Input-output in Java with Examples
  • Java.io.Reader class in Java
  • Java.io.Writer Class in Java
  • Java.io.FileInputStream Class in Java
  • FileOutputStream in Java
  • Java.io.BufferedOutputStream class in Java
  • Java Networking
  • TCP/IP Model
  • User Datagram Protocol (UDP)
  • Differences between IPv4 and IPv6
  • Difference between Connection-oriented and Connection-less Services
  • Socket Programming in Java
  • java.net.ServerSocket Class in Java
  • URL Class in Java with Examples

JDBC - Java Database Connectivity

  • Introduction to JDBC (Java Database Connectivity)
  • JDBC Drivers
  • Establishing JDBC Connection in Java
  • Types of Statements in JDBC
  • JDBC Tutorial
  • Java 8 Features - Complete Tutorial

Java, Inheritance is an important pillar of OOP(Object-Oriented Programming). It is the mechanism in Java by which one class is allowed to inherit the features(fields and methods) of another class. In Java, Inheritance means creating new classes based on existing ones. A class that inherits from another class can reuse the methods and fields of that class. In addition, you can add new fields and methods to your current class as well.  

Why Do We Need Java Inheritance?

  • Code Reusability: The code written in the Superclass is common to all subclasses. Child classes can directly use the parent class code.
  • Method Overriding: Method Overriding is achievable only through Inheritance. It is one of the ways by which Java achieves Run Time Polymorphism.
  • Abstraction: The concept of abstract where we do not have to provide all details is achieved through inheritance. Abstraction only shows the functionality to the user.

Important Terminologies Used in Java Inheritance

  • Class: Class is a set of objects which shares common characteristics/ behavior and common properties/ attributes. Class is not a real-world entity. It is just a template or blueprint or prototype from which objects are created.
  • Super Class/Parent Class: The class whose features are inherited is known as a superclass(or a base class or a parent class).
  • Sub Class/Child Class: The class that inherits the other class is known as a subclass(or a derived class, extended class, or child class). The subclass can add its own fields and methods in addition to the superclass fields and methods.
  • Reusability: Inheritance supports the concept of “reusability”, i.e. when we want to create a new class and there is already a class that includes some of the code that we want, we can derive our new class from the existing class. By doing this, we are reusing the fields and methods of the existing class.

How to Use Inheritance in Java?

The extends keyword is used for inheritance in Java. Using the extends keyword indicates you are derived from an existing class. In other words, “extends” refers to increased functionality.

Inheritance in Java Example

Example: In the below example of inheritance, class Bicycle is a base class, class MountainBike is a derived class that extends the Bicycle class and class Test is a driver class to run the program. 

In the above program, when an object of MountainBike class is created, a copy of all methods and fields of the superclass acquires memory in this object. That is why by using the object of the subclass we can also access the members of a superclass. 

Please note that during inheritance only the object of the subclass is created, not the superclass. For more, refer to Java Object Creation of Inherited Class . 

Example 2: In the below example of inheritance, class Employee is a base class, class Engineer is a derived class that extends the Employee class and class Test is a driver class to run the program.

Illustrative image of the program: 

Inheritance in Java

In practice, inheritance, and polymorphism are used together in Java to achieve fast performance and readability of code.

Java Inheritance Types

Below are the different types of inheritance which are supported by Java.

  • Single Inheritance

Multilevel Inheritance

  • Hierarchical Inheritance

Multiple Inheritance

Hybrid Inheritance

1. Single Inheritance

In single inheritance, subclasses inherit the features of one superclass. In the image below, class A serves as a base class for the derived class B.

Single inheritance

Single inheritance

2. Multilevel Inheritance

In Multilevel Inheritance, a derived class will be inheriting a base class, and as well as the derived class also acts as the base class for other classes. In the below image, class A serves as a base class for the derived class B, which in turn serves as a base class for the derived class C. In Java, a class cannot directly access the grandparent’s members .

Multilevel Inheritance

3. Hierarchical Inheritance

In Hierarchical Inheritance, one class serves as a superclass (base class) for more than one subclass. In the below image, class A serves as a base class for the derived classes B, C, and D.

Hierarchical-Inheritance-in-Java

4. Multiple Inheritance ( Through Interfaces)

In Multiple inheritances , one class can have more than one superclass and inherit features from all parent classes. Please note that Java does not support multiple inheritances with classes. In Java, we can achieve multiple inheritances only through Interfaces . In the image below, Class C is derived from interfaces A and B.

Multiple Inheritance

5. Hybrid Inheritance

It is a mix of two or more of the above types of inheritance. Since Java doesn’t support multiple inheritances with classes, hybrid inheritance involving multiple inheritance is also not possible with classes. In Java, we can achieve hybrid inheritance only through Interfaces if we want to involve multiple inheritance to implement Hybrid inheritance. However, it is important to note that Hybrid inheritance does not necessarily require the use of Multiple Inheritance exclusively. It can be achieved through a combination of Multilevel Inheritance and Hierarchical Inheritance with classes, Hierarchical and Single Inheritance with classes. Therefore, it is indeed possible to implement Hybrid inheritance using classes alone, without relying on multiple inheritance type. 

Hybrid Inheritance

Java IS-A type of Relationship

IS-A is a way of saying: This object is a type of that object. Let us see how the extends keyword is used to achieve inheritance.

Now, based on the above example, in Object-Oriented terms, the following are true:-

  • SolarSystem is the superclass of Earth class.
  • SolarSystem is the superclass of Mars class.
  • Earth and Mars are subclasses of SolarSystem class.
  • Moon is the subclass of both Earth and SolarSystem classes.

What Can Be Done in a Subclass?

In sub-classes we can inherit members as is, replace them, hide them, or supplement them with new members: 

  • The inherited fields can be used directly, just like any other fields.
  • We can declare new fields in the subclass that are not in the superclass.
  • The inherited methods can be used directly as they are.
  • We can write a new instance method in the subclass that has the same signature as the one in the superclass, thus overriding it (as in the example above, toString() method is overridden).
  • We can write a new static method in the subclass that has the same signature as the one in the superclass, thus hiding it.
  • We can declare new methods in the subclass that are not in the superclass.
  • We can write a subclass constructor that invokes the constructor of the superclass, either implicitly or by using the keyword super .

 Advantages Of Inheritance in Java:

  • Code Reusability: Inheritance allows for code reuse and reduces the amount of code that needs to be written. The subclass can reuse the properties and methods of the superclass, reducing duplication of code.
  • Abstraction: Inheritance allows for the creation of abstract classes that define a common interface for a group of related classes. This promotes abstraction and encapsulation, making the code easier to maintain and extend.
  • Class Hierarchy: Inheritance allows for the creation of a class hierarchy, which can be used to model real-world objects and their relationships.
  • Polymorphism: Inheritance allows for polymorphism, which is the ability of an object to take on multiple forms. Subclasses can override the methods of the superclass, which allows them to change their behavior in different ways.

Disadvantages of Inheritance in Java:

  • Complexity: Inheritance can make the code more complex and harder to understand. This is especially true if the inheritance hierarchy is deep or if multiple inheritances is used.
  • Tight Coupling: Inheritance creates a tight coupling between the superclass and subclass, making it difficult to make changes to the superclass without affecting the subclass.

Let us check some important points from the article are mentioned below:

  • Default superclass : Except Object class, which has no superclass, every class has one and only one direct superclass (single inheritance). In the absence of any other explicit superclass, every class is implicitly a subclass of the Object class.
  • Superclass can only be one: A superclass can have any number of subclasses. But a subclass can have only one superclass. This is because Java does not support multiple inheritances with classes. Although with interfaces, multiple inheritances are supported by Java.
  • Inheriting Constructors: A subclass inherits all the members (fields, methods, and nested classes) from its superclass. Constructors are not members, so they are not inherited by subclasses, but the constructor of the superclass can be invoked from the subclass.
  • Private member inheritance: A subclass does not inherit the private members of its parent class. However, if the superclass has public or protected methods(like getters and setters) for accessing its private fields, these can also be used by the subclass.

FAQs in Inheritance

1. what is inheritance java.

Inheritance is a concept of OOPs where one class inherits from another class that can reuse the methods and fields of the parent class.

2. What are the 4 types of inheritance in Java?

There are Single, Multiple, Multilevel, Hierarchical and Hybrid

3. What is the use of extend keyword?

Extend keyword is used for inheriting one class into another.

4. What is an example of inheritance in Java?

A real-world example of Inheritance in Java is mentioned below:

Consider a group of vehicles. You need to create classes for Bus, Car, and Truck. The methods fuelAmount(), capacity(), applyBrakes() will be the same for all three classes.
References Used: “Head First Java” by Kathy Sierra and Bert Bates “Java: A Beginner’s Guide” by Herbert Schildt “Java: The Complete Reference” by Herbert Schildt “Effective Java” by Joshua Bloch “Java: The Good Parts” by Jim Waldo.

Please Login to comment...

Similar reads, improve your coding skills with practice.

 alt=

What kind of Experience do you want to share?

Java Inheritance Tutorial: explained with examples

Java Inheritance Tutorial

  • is-a relationship

In Java, inheritance is an is-a relationship. That is, we use inheritance only if there exists an is-a relationship between two classes. For example,

  • Car is a Vehicle
  • Orange is a Fruit
  • Surgeon is a Doctor
  • Dog is an Animal

Here, Car can inherit from Vehicle , Orange can inherit from Fruit , and so on.

Method Overriding in Java Inheritance

In Example 1 , we see the object of the subclass can access the method of the superclass.

However, if the same method is present in both the superclass and subclass, what will happen?

In this case, the method in the subclass overrides the method in the superclass. This concept is known as method overriding in Java.

Example 2: Method overriding in Java Inheritance

In the above example, the eat() method is present in both the superclass Animal and the subclass Dog .

Here, we have created an object labrador of Dog .

Now when we call eat() using the object labrador , the method inside Dog is called. This is because the method inside the derived class overrides the method inside the base class.

This is called method overriding. To learn more, visit Java Method Overriding .

Note : We have used the @Override annotation to tell the compiler that we are overriding a method. However, the annotation is not mandatory. To learn more, visit Java Annotations .

super Keyword in Java Inheritance

Previously we saw that the same method in the subclass overrides the method in superclass.

In such a situation, the super keyword is used to call the method of the parent class from the method of the child class.

Example 3: super Keyword in Inheritance

In the above example, the eat() method is present in both the base class Animal and the derived class Dog . Notice the statement,

Here, the super keyword is used to call the eat() method present in the superclass.

We can also use the super keyword to call the constructor of the superclass from the constructor of the subclass. To learn more, visit Java super keyword .

protected Members in Inheritance

In Java, if a class includes protected fields and methods, then these fields and methods are accessible from the subclass of the class.

Example 4: protected Members in Inheritance

In the above example, we have created a class named Animal. The class includes a protected field: name and a method: display() .

We have inherited the Dog class inherits Animal . Notice the statement,

Here, we are able to access the protected field and method of the superclass using the labrador object of the subclass.

  • Why use inheritance?
  • The most important use of inheritance in Java is code reusability. The code that is present in the parent class can be directly used by the child class.
  • Method overriding is also known as runtime polymorphism. Hence, we can achieve Polymorphism in Java with the help of inheritance.
  • Types of inheritance

There are five types of inheritance.

1. Single Inheritance

In single inheritance, a single subclass extends from a single superclass. For example,

Class A inherits from class B.

2. Multilevel Inheritance

In multilevel inheritance, a subclass extends from a superclass and then the same subclass acts as a superclass for another class. For example,

Class B inherits from class A and class C inherits from class B.

3. Hierarchical Inheritance

In hierarchical inheritance, multiple subclasses extend from a single superclass. For example,

Both classes B and C inherit from the single class A.

4. Multiple Inheritance

In multiple inheritance, a single subclass extends from multiple superclasses. For example,

Class C inherits from both classes A and B.

Note : Java doesn't support multiple inheritance. However, we can achieve multiple inheritance using interfaces. To learn more, visit Java implements multiple inheritance .

5. Hybrid Inheritance

Hybrid inheritance is a combination of two or more types of inheritance. For example,

Class B and C inherit from a single class A and class D inherits from both the class B and C.

Here, we have combined hierarchical and multiple inheritance to form a hybrid inheritance.

Table of Contents

  • Introduction
  • Example: Java Inheritance
  • Method Overriding Inheritance
  • super Keyword Inheritance
  • protected Members and Inheritance

Sorry about that.

Related Tutorials

Java Tutorial

Java Tutorial

Java methods, java classes, java file handling, java how to, java reference, java examples, java inheritance, java inheritance (subclass and superclass).

In Java, it is possible to inherit attributes and methods from one class to another. We group the "inheritance concept" into two categories:

  • subclass (child) - the class that inherits from another class
  • superclass (parent) - the class being inherited from

To inherit from a class, use the extends keyword.

In the example below, the Car class (subclass) inherits the attributes and methods from the Vehicle class (superclass):

Try it Yourself »

Did you notice the protected modifier in Vehicle?

We set the brand attribute in Vehicle to a protected access modifier . If it was set to private , the Car class would not be able to access it.

Why And When To Use "Inheritance"?

- It is useful for code reusability: reuse attributes and methods of an existing class when you create a new class.

Tip: Also take a look at the next chapter, Polymorphism , which uses inherited methods to perform different tasks.

Advertisement

The final Keyword

If you don't want other classes to inherit from a class, use the final keyword:

If you try to access a final class, Java will generate an error:

The output will be something like this:

Get Certified

COLOR PICKER

colorpicker

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: [email protected]

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail: [email protected]

Top Tutorials

Top references, top examples, get certified.

Java Inheritance Uncovered: A Comprehensive Guide to Understanding, Implementing, and Leveraging Inheritance in Java

Inheritance is one of the four pillars of Object-Oriented Programming (OOP) and a powerful mechanism that allows one class to inherit the attributes and methods of another class. Inheritance promotes code reuse, modularity, and maintainability in Java applications. In this blog post, we will explore the concept of inheritance in Java, its syntax, types, and best practices.

Understanding Inheritance in Java

Inheritance enables a class (subclass) to inherit the properties and behaviors of another class (superclass). This relationship between the two classes creates a hierarchy, allowing the subclass to reuse code from the superclass and add or override its attributes and methods.

Terminology

  • Superclass : The class that is being inherited by another class.
  • Subclass : The class that inherits from another class.
  • Inheritance : The process by which a subclass inherits the properties and behaviors of a superclass.

Implementing Inheritance in Java

To implement inheritance in Java, use the extends keyword followed by the name of the superclass.

In this example, the Car class inherits the attributes and methods of the Vehicle class.

Accessing Superclass Members

When a subclass inherits from a superclass, it can access the superclass's attributes and methods, subject to their access modifiers.

Accessing Superclass Attributes

A subclass can access the superclass's public and protected attributes directly. However, it cannot access the superclass's private attributes. To access private attributes, provide public getter and setter methods in the superclass.

Accessing Superclass Methods

A subclass can access the superclass's public and protected methods directly. However, it cannot access the superclass's private methods. To access private methods, provide public or protected methods in the superclass.

Method Overriding

Method overriding is the process of providing a new implementation for a method inherited from a superclass. The new implementation must have the same method signature (name, return type, and parameters) as the original method.

In this example, the Car class overrides the start() method inherited from the Vehicle class.

The super Keyword

The super keyword is used to refer to the superclass and can be used to access superclass members or call the superclass constructor.

Use the super keyword followed by the dot (.) operator to access the superclass's attributes and methods. This is particularly useful when you want to call the superclass's method from an overridden method in the subclass.

Calling the Superclass Constructor

The super keyword can also be used to call the superclass constructor from the subclass constructor. This is essential when the superclass has a parameterized constructor and requires specific initialization.

Types of Inheritance in Java

Java supports several types of inheritance, including:

Single Inheritance

In single inheritance, a class inherits from only one superclass. Java supports single inheritance through the extends keyword.

Multilevel Inheritance

In multilevel inheritance, a class inherits from a superclass, which in turn inherits from another superclass, forming a chain of inheritance. Java supports multilevel inheritance through the extends keyword.

Hierarchical Inheritance

In hierarchical inheritance, multiple classes inherit from a single superclass. Java supports hierarchical inheritance through the extends keyword.

Best Practices for Using Inheritance in Java

To make the most of inheritance in Java, follow these best practices:

Use Inheritance for "Is-A" Relationships

Inheritance should be used to model "is-a" relationships between classes. For example, a Car is a Vehicle , so it makes sense for the Car class to inherit from the Vehicle class.

Use Composition for "Has-A" Relationships

Instead of inheritance, use composition to model "has-a" relationships. Composition allows you to create more flexible and maintainable code by combining simpler objects to create more complex objects.

Favor Method Overriding Over Hiding

When redefining a method in a subclass, use method overriding instead of method hiding. Overriding provides a more consistent and maintainable approach to modifying inherited behavior.

Do Not Overuse Inheritance

Avoid overusing inheritance, as it can lead to code complexity and rigidity. Instead, focus on creating modular, maintainable code with composition and interfaces.

Inheritance is a powerful concept in Java that allows you to reuse code, create modular designs, and leverage existing functionality. By understanding the different types of inheritance and following best practices, you can create more maintainable and efficient Java applications.

SlidePlayer

  • My presentations

Auth with social network:

Download presentation

We think you have liked this presentation. If you wish to download it, please recommend it to your friends in any social system. Share buttons are a little bit lower. Thank you!

Presentation is loading. Please wait.

INHERITANCE IN JAVA.

Published by Lester Arnold Modified over 5 years ago

Similar presentations

Presentation on theme: "INHERITANCE IN JAVA."— Presentation transcript:

INHERITANCE IN JAVA

Final and Abstract Classes

presentation on inheritance in java

Inheritance. Many objects have a hierarchical relationship –Examples: zoo, car/vehicle, card game, airline reservation system Inheritance allows software.

presentation on inheritance in java

Chapter 1 Inheritance University Of Ha’il.

presentation on inheritance in java

INHERITANCE BASICS Reusability is achieved by INHERITANCE

presentation on inheritance in java

METHOD OVERRIDING 1.Sub class can override the methods defined by the super class. 2.Overridden Methods in the sub classes should have same name, same.

presentation on inheritance in java

OOP: Inheritance By: Lamiaa Said.

presentation on inheritance in java

Objectives Introduction to Inheritance and Composition (Subclasses and SuperClasses) Overriding (and extending), and inheriting methods and constructors.

presentation on inheritance in java

Inheritance. In this chapter, we will cover: The concept of inheritance Extending classes Overriding superclass methods Working with superclasses that.

presentation on inheritance in java

OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.

presentation on inheritance in java

1 Chapter 6 Inheritance, Interfaces, and Abstract Classes.

presentation on inheritance in java

Inheritance and Polymorphism Recitation – 10/(16,17)/2008 CS 180 Department of Computer Science, Purdue University.

presentation on inheritance in java

CS 2511 Fall  Abstraction Abstract class Interfaces  Encapsulation Access Specifiers Data Hiding  Inheritance  Polymorphism.

presentation on inheritance in java

OOP in Java Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.

presentation on inheritance in java

Introduction to Object Oriented Programming. Object Oriented Programming Technique used to develop programs revolving around the real world entities In.

presentation on inheritance in java

Programming in Java Unit 2. Class and variable declaration A class is best thought of as a template from which objects are created. You can create many.

presentation on inheritance in java

Specialization and Inheritance Chapter 8. 8 Specialization Specialized classes inherit the properties and methods of the parent or base class. A dog is.

presentation on inheritance in java

Inheritance. Introduction Inheritance is one of the cornerstones of object-oriented programming because it allows the creation of hierarchical classifications.

presentation on inheritance in java

Inheritance Chapter 10 Programs built from objects/instances of classes An O.O. approach – build on earlier work. Use classes in library and ones you have.

presentation on inheritance in java

Programming With Java ICS201 University Of Ha’il1 Chapter 7 Inheritance.

presentation on inheritance in java

Chapter 10: Introduction to Inheritance. Objectives Learn about the concept of inheritance Extend classes Override superclass methods Call constructors.

About project

© 2024 SlidePlayer.com Inc. All rights reserved.

Javatpoint Logo

Java Tutorial

Control statements, java object class, java inheritance, java polymorphism, java abstraction, java encapsulation, java oops misc.

JavaTpoint

  • Send your Feedback to [email protected]

Help Others, Please Share

facebook

Learn Latest Tutorials

Splunk tutorial

Transact-SQL

Tumblr tutorial

Reinforcement Learning

R Programming tutorial

R Programming

RxJS tutorial

React Native

Python Design Patterns

Python Design Patterns

Python Pillow tutorial

Python Pillow

Python Turtle tutorial

Python Turtle

Keras tutorial

Preparation

Aptitude

Verbal Ability

Interview Questions

Interview Questions

Company Interview Questions

Company Questions

Trending Technologies

Artificial Intelligence

Artificial Intelligence

AWS Tutorial

Cloud Computing

Hadoop tutorial

Data Science

Angular 7 Tutorial

Machine Learning

DevOps Tutorial

B.Tech / MCA

DBMS tutorial

Data Structures

DAA tutorial

Operating System

Computer Network tutorial

Computer Network

Compiler Design tutorial

Compiler Design

Computer Organization and Architecture

Computer Organization

Discrete Mathematics Tutorial

Discrete Mathematics

Ethical Hacking

Ethical Hacking

Computer Graphics Tutorial

Computer Graphics

Software Engineering

Software Engineering

html tutorial

Web Technology

Cyber Security tutorial

Cyber Security

Automata Tutorial

C Programming

C++ tutorial

Control System

Data Mining Tutorial

Data Mining

Data Warehouse Tutorial

Data Warehouse

RSS Feed

inheritance in java

Inheritance in Java

Mar 17, 2019

330 likes | 478 Views

Inheritance in Java. CS 3331. Two Programming Languages Words . Overloading Overriding. Overloading of Methods and Constructors. public class Point { public Point() { /* … */ } public Point(int x, int y) { /* … */ } public double distance(Point other) { /* … */ }

Share Presentation

  • public class
  • public point
  • public point int
  • public string substring int

nuwa

Presentation Transcript

Inheritance in Java CS 3331

Two Programming Languages Words • Overloading • Overriding

Overloading of Methods and Constructors • public class Point { • public Point() { /* … */ } • public Point(int x, int y) { /* … */ } • public double distance(Point other) { /* … */ } • public double distance(int x, int y) { /* … */ } • public double distance() { /* … */ } • // … • }

Why use overloading?

Why use overloading? public class StringBuffer { public StringBuffer append(String str) { /* … */ } public StringBuffer append(boolean b) { /* … */ } public StringBuffer append(char c) { /* … */ } public StringBuffer append(int i) { /* … */ } public StringBuffer append(long l) { /* … */ } // … }

When to Overload? (Cont.) public class String { public String substring(int i, int j) { // base method: return substring from index i to j - 1. } public String substring(int i) { // provide default argument return substring(i, length()); } // … }

How does Java figure out which method to use? • new StringBuffer sb = append( …);

Overloading • 1: Point() Point() • 2: Point(int x,int y) Point(int,int) • 3: double distance(Point other) distance(Point) • 4: double distance(int x,int y) distance(int,int) • 5: double distance() distance() • Point p1 = new Point(); // which constructor? • Point p2 = new Point(10,20); • p2.distance(p1); // which method? • p2.distance(20,30); • p2.distance();

Overriding Methods • Def. Overriding • Consequences

Overriding Methods (Cont.) public class T { public void m() { … } } public class S extends T { public void m() { … } } T t = new T(); S s = new S(); t.m(); // invoke m of class T s.m(); // invoke m of class S

What value is returned? class Student { public int maxCredits() { return 15; } … } class GraduateStudent extends Student { public int maxCredits() { return 12; } … } Student s; // … s.getMaxCredits(); // which maxCredits method?

Implementation of Dynamic Binding • Storage structure of instance variables • Dynamic bindings of messages to methods

Dynamic Binding (Cont.) class Point { private int x, y; public Point(int x, int y) { this.x = x; this.y = y; } public int getX() { return x; } public int getY() { return y; } } class ColoredPoint extends Point { private Color color; public ColoredPoint(int x, int y, Color c) { super(x, y); color = c; } public Color getColor() { return color; } }

Object.class Point.class p: getX: getY: … super: vmt: … super: vmt: … super: vmt: … ColoredPoint.class class: x: 10 y: 20 color: getColor: … Color.RED Dynamic Binding (Cont.) ColoredPoint p = new ColoredPoint(10,20,Color.RED); p.getColor(); p.getX();

Overriding Methods (Cont.)

Hiding Fields and Class Methods • Def. Hiding

Example class Student { protected String description = “Student”; public String getDescription() { return description; } } class Undergraduate extends Student { protected String description = “Undergraduate”; } new Student().getDecription(); // what value is returned? new Undergraduate().getDescription(); // what value? Q. How to refer to hidden fields?

Hiding vs. overriding • Statically resolved (bound) at compile-time vs. dynamically dispatched at run-time

Another Example class Point { public String description = “Point”; } class CPoint extends Point { public String description = “CPoint”; } CPoint c1 = new CPoint(); Point c2 = c1; system.out.println (c1.description); system.out.println (c2.description);

Inheritance • Inheritance models the is-a relationship. • If class S extends class T, then all objects of S can act-like an object of T. • In Java, only single inheritance is allowed among classes. • All public and protected members of a superclass are accessible in the subclasses.* *All protected members are also accessible within the package.

Constructors of Subclasses • Can invoke a constructor of the direct superclass. • super(…) must be the first statement. • If the super constructor call is missing, by default the no-arg super() is invoked implicitly. • Can also invoke another constructor of the same class. • this(…) must be the first statement.

Example of “this” Calls public class Point { private int x, y; public Point(int x, int y) { this.x = x; this.y = y; } public Point() { // default constructor this.x = 0; this.y = 0; } }

Example of “super” Calls public class ColoredPoint extends Point { private Color color; public ColoredPoint(int x, int y, Color color) { this.x = x; this.y = y; this.color = color; } public ColoredPoint(int x, int y) { this(x, y, Color.BLACK); // point with default value } public ColoredPoint() { color = Color.BLACK; // what will be the values of x and y? } }

Default Constructor public ClassName() { super(); } Q. What would be the use of default constructor?

Execution Order of Constructors public class T { int x = 10; // first public T() { x = 20; // second } // ... } public class S extends T { int y = 30; // third public S() { super(); y = 40; // fourth } // ... }

Types • What is a “type”?

Subtyping • What’s subtyping?

Substitution Property • Def. Substitution property • A value of subtype can appear where a value of its supertype is expected, e.g., in arguments, results, receivers, and assignments.

Substitution Property (Cont.) • Rules of (polymorphic) assignment • The type of expression at the right-hand side of an assignment must be a subtype of the type of the variable at the left-hand side of the assignment. class Student { … } class Undergraduate extends Student { … } class Graduate extends Student { … } Student s1, s2; s1 = new Undergradute(); // polymorphic assignment s2 = new Graduate(); // polymorphic assignment Graduate s3 = s2; // is this OK? Graduate s3 = (Graduate) s2; // explicit casting

Widening and Narrowing • Def. widening and narrowing • The conversion of a subtype to one of its supertypes is called widening, and the conversion of a supertype to one of its subtype is called narrowing (or downcasting). // s is a stack of strings Stack s = new Stack(); s.push(“Hello”); … // Stack defines a method top, i.e., “public Object top()”. s.top().size(); // okay? ((String) s.top()).size(); // downcasting

  • More by User

Java Classes and Inheritance

Java Classes and Inheritance

Java Classes and Inheritance. Object (again): A computational unit consisting of some data elements to which are associated some specific methods for operating on them. Class: A category of objects having a single formal description in a software system.

428 views • 16 slides

Class Design in Java Overloading 	Programming with Multiple Classes 	Inheritance 	Inheritance and Access Control

Class Design in Java Overloading Programming with Multiple Classes Inheritance Inheritance and Access Control

:: OOP :: Object Oriented Programming Lec10 :: Overloading By Nattapong Songneam http://www.siam2dev.com Information technology Rajabhat pranakhon university. Class Design in Java Overloading Programming with Multiple Classes Inheritance Inheritance and Access Control.

870 views • 60 slides

Inheritance in Java

Inheritance in Java. CS 3331 Fall 2009. Outline. Overloading Inheritance and object initialization Subtyping Overriding Hiding. constructor overloading. public class Point { public Point() { /* … */ } public Point(int x, int y) { /* … */ }

803 views • 32 slides

Multiple Code Inheritance in Java

Multiple Code Inheritance in Java

Multiple Code Inheritance in Java. Maria Cutumisu Supervisors: Duane Szafron, Paul Lu. Outline. Overview Motivation Implementation Validation Syntax Support for Compilation Conclusions. Type Separation Mechanisms in Java. Type. Interface. Class. We want separation of types.

310 views • 17 slides

Some Inheritance Issues in Java

Some Inheritance Issues in Java

Some Inheritance Issues in Java. Inheritance. protected members in Java are visible to the package as well as to subclasses Java: public, private, protected, (default) C++: public, private, protected. Inheritance. We have already mentioned the name collision resolution differences

268 views • 18 slides

Java 212: Inheritance and Polymorphism

Java 212: Inheritance and Polymorphism

Java 212: Inheritance and Polymorphism. Chapter Objectives. Learn about inheritance Learn about subclasses and superclasses Explore how to override (not overload!) the methods of a superclass Examine how constructors of superclasses and subclasses work.

792 views • 59 slides

Inheritance using Java

Inheritance using Java

Inheritance using Java. Terms source: http://www.learn-java-tutorial.com/Java-Inheritance.cfm. Why inheritance?. to model hierarchies found in the real world to allow customization for some features, and have some features that are common to all Also helpful with maintenance

540 views • 9 slides

Inheritance, polymorphism & typing rules in Java – revision

Inheritance, polymorphism & typing rules in Java – revision

Inheritance, polymorphism & typing rules in Java – revision. or: Everything you wanted to know about OOP but were afraid to ask. SOFTENG 251 Object Oriented Software Construction. Who I am. Hong Yul Yang PhD candidate (another one) Software Engineering alumni 2000 – 2003

466 views • 31 slides

Java Unit 11: Inheritance I

Java Unit 11: Inheritance I

Java Unit 11: Inheritance I. What is Inheritance?. Inheritance. All classes in Java are related to each other in a hierarchical way. Except for the class at the top of the hierarchy, which has nothing above it, a class has exactly one class immediately above it in the hierarchy.

365 views • 18 slides

Inheritance in Java

Inheritance in Java. What is inheritance (in Java)?. Inheritance is a mechanism for enhancing existing classes What does that mean…? Defining new classes, which build on the function-ality of existing classes. What is inheritance (in Java)?.

4.92k views • 27 slides

Abstraction, Inheritance, and Polymorphism in Java

Abstraction, Inheritance, and Polymorphism in Java

Abstraction, Inheritance, and Polymorphism in Java.

461 views • 34 slides

Java Inheritance and Polymorphism

Java Inheritance and Polymorphism

Java Inheritance and Polymorphism. Inheritance. Definitions. A class that is derived from another class is called a subclass (also a derived class, extended class, or child class). The class from which the subclass is derived is called a superclass (also a base class or a parent class).

347 views • 18 slides

Java interface and inheritance

Java interface and inheritance

"For more Classes Visit www.tutorialoutlet.com Java interface and inheritance"

51 views • 3 slides

How do I use inheritance in Java?

How do I use inheritance in Java?

Java class supports reuse through inheritance and composition. This two-part tutorial shows you how to use inheritance in your Java programs. In Part 1, Learn how to use the extends keyword to derive a child from a parent class. In part 2 you will visit java.long.Object, this is the superclass of Java, from which any other class inherits.

120 views • 11 slides

Java Persistence: Object Inheritance Mapping

Java Persistence: Object Inheritance Mapping

Java Persistence: Object Inheritance Mapping. Goals. Be able to map a inheritance relationships between classes to the database using class annotations and ORM descriptors. Objectives. Strategies Single Table Per Class Table per Concrete Class Table per Class (Join) Non-entity inheritance

474 views • 46 slides

Java Classes and Inheritance

175 views • 16 slides

Inheritance in Java

Inheritance in Java Inheritance in java is a mechanism in which one object acquires all the properties and behaviors of parent object.

899 views • 60 slides

Object Oriented Programming using Java -  Inheritance  Overview

Object Oriented Programming using Java - Inheritance Overview

Department of Computer and Information Science, School of Science, IUPUI. Object Oriented Programming using Java - Inheritance Overview. Dale Roberts, Lecturer Computer Science, IUPUI E-mail: [email protected]. Introduction. Inheritance Software reusability

263 views • 24 slides

Java Inheritance

Java Inheritance

Java Inheritance. What is inherited. A subclass inherits variables and methods from its superclass and all of its ancestors. The subclass can use these members as is, or it can hide the member variables or override the methods. A little more detail.

205 views • 12 slides

Java Inheritance | Java Inheritance Program Example | Java Inheritance Tutorial | Simplilearn

Java Inheritance | Java Inheritance Program Example | Java Inheritance Tutorial | Simplilearn

This presentation on Java Inheritence will give an introduction to the inheritence concept in Java Object-Oriented Programming concepts. In this video, we will understand how to perform inheritence across Java classes using an example of mobile phones. Whether you are an experienced programmer or not, this channel is intended for everyone who wishes to learn Java programming. You will also learn about how to use private variables in a class. And, at the end of the concept, you will see an exciting program so that you will have in-depth knowledge of Java encapsulation. About Simplilearn Java certification training course: If youu2019re looking to master web application development for virtually any computing platform, this Java Certification Training course is for you. This all-in-one Java training will give you a firm foundation in Java, the most commonly used programming language in software development. This advanced Java Certification Training course is designed to guide you through the concepts of Java from introductory techniques to advanced programming skills. The course will provide you with the knowledge of Core Java 8, operators, arrays, loops, methods, and constructors while giving you hands-on experience in JDBC and JUnit framework. Java Certification Course Key Features: 1. 70 hours of blended training 2. Hands-on coding and implementation of two web-based projects 3. Includes Hibernate and Spring frameworks 4. 35 coding-related exercises on Core Java 8 5. Lifetime access to self-paced learning 6. Flexibility to choose classes Eligibility: Simplilearnu2019s Java Certification Training course is ideal for software developers, web designers, programming enthusiasts, engineering graduates, and students or professionals who wish to become Java developers. Pre-requisites: Prior knowledge of Core Java is a prerequisite to taking this advanced Java Certification training course. Our Core Java online self-paced course is available for free to become familiar with the basics of Java programming. Learn more at https://www.simplilearn.com/mobile-and-software-development/java-javaee-soa-development-training

247 views • 12 slides

IMAGES

  1. Inheritance in Java

    presentation on inheritance in java

  2. what is inheritance in java programming?

    presentation on inheritance in java

  3. Inheritance in Java

    presentation on inheritance in java

  4. What is Inheritance in Java with Examples

    presentation on inheritance in java

  5. What is Inheritance in Java with Examples

    presentation on inheritance in java

  6. PPT

    presentation on inheritance in java

VIDEO

  1. inheritance java example #shorts #coding #bca

  2. 48. Does Java support multiple inheritance?

  3. What is Inheritance in Java #computer #coding #java

  4. Inheritance part 1 by Neeraj sir

  5. Group 4 Presentation

  6. Intro to Inheritance

COMMENTS

  1. Inheritance in JAVA PPT

    Inheritance in JAVA PPT. Nov 24, 2014 • Download as PPTX, PDF •. 39 likes • 36,696 views. P. Pooja Jaiswal. A description on Inheritance in Java (PPT). Presentations & Public Speaking. 1 of 16. Download now.

  2. Inheritance in Java

    Inheritance in Java. Java, Inheritance is an important pillar of OOP (Object-Oriented Programming). It is the mechanism in Java by which one class is allowed to inherit the features (fields and methods) of another class. In Java, Inheritance means creating new classes based on existing ones.

  3. Java Inheritance Tutorial: explained with examples

    Inheritance is the process of building a new class based on the features of another existing class. It is used heavily in Java, Python, and other object-oriented languages to increase code reusability and simplify program logic into categorical and hierarchical relationships. However, each language has its own unique way of implementing ...

  4. Java Inheritance (With Examples)

    Learn how to use inheritance in Java to create a new class from an existing class. See examples of single, multilevel, and multiple inheritance, method overriding, and super keyword.

  5. Guide to Inheritance in Java

    Learn how to use inheritance in Java to reuse existing code or extend existing types. The guide covers class and interface inheritance, access modifiers, and type inheritance with examples and diagrams.

  6. Inheritance in Java

    Learn about inheritance in Java, a mechanism that allows one class to acquire the properties and behaviors of another class. See examples of single, multilevel, hierarchical and hybrid inheritance, and why multiple inheritance is not possible in Java.

  7. Java Inheritance (Subclass and Superclass)

    In Java, it is possible to inherit attributes and methods from one class to another. We group the "inheritance concept" into two categories: subclass (child) - the class that inherits from another class. superclass (parent) - the class being inherited from. To inherit from a class, use the extends keyword.

  8. Java Inheritance Demystified: A Comprehensive Guide to Mastering

    Inheritance is a powerful concept in Java that allows you to reuse code, create modular designs, and leverage existing functionality. By understanding the different types of inheritance and following best practices, you can create more maintainable and efficient Java applications. Dive deep into the concept of inheritance in Java, a fundamental ...

  9. Inheritance in Java. A Comprehensive Guide

    Definition. Inheritance is a mechanism in which one class acquires the properties and behaviors of another class. The class that inherits is known as the subclass, and the class from which properties are inherited is known as the superclass. In Java, inheritance is achieved using the extends keyword.

  10. INHERITANCE IN JAVA.

    Download ppt "INHERITANCE IN JAVA." Inheritance in Java Mechanism of deriving new class from old class. The old class is known as- Base Class / Super class / Parent Class The new class is known as- Derived class/ Sub Class / Child class Types: Single Inheritance Multilevel Inheritance Multiple inheritance Hierarchical Inheritance.

  11. Inheritance in java

    Inheritance in java. Nov 16, 2020 • Download as PPTX, PDF •. 2 likes • 6,263 views. R. RahulAnanda1. This is the presentation file about inheritance in java. You can learn details about inheritance and method overriding in inheritance in java. I think it's can help your. Thank you.

  12. PPT

    Inheritance vs. Interfaces • One quite important difference between inheritance and interfaces: • A class can implement multiple interfaces • A class can only extend one class • There is no such thing as multiple inheritance in Java…. • Multiple inheritance has issues, taken out of Java to keep things simple RHS - SOC.

  13. What is Inheritance in Java and How to Implement It

    Types of Inheritance in Java. There are five types of inheritance in Java: 1) Single Inheritance 2) Multi-Level Inheritance 3) Hierarchical Inheritance 4) Hybrid Inheritance 5) Multiple Inheritance We will discuss each one of them in detail. Single Inheritance. Single inheritance consists of one parent class and one child class.

  14. PPT

    Presentation Transcript. Inheritance in Java Inheritance in java is a mechanism in which one object acquires all the properties and behaviors of parent object. The idea behind inheritance in java is that you can create new classes that are built upon existing classes. When you inherit from an existing class, you can reuse methods and fields of ...

  15. Types of Inheritance in Java

    Types of Inheritance in Java. Inheritance is the most powerful feature of object-oriented programming.It allows us to inherit the properties of one class into another class. In this section, we will discuss types of inheritance in Java in-depth with real-life examples. Also, we will create Java programs to implement the concept of different types of inheritance.

  16. Chapter 06

    Chapter 06 - Inheritance in Java.ppt - Free download as Powerpoint Presentation (.ppt / .pptx), PDF File (.pdf), Text File (.txt) or view presentation slides online. Java Programming Slides (Dr. Fayaz Memon , Department of CSE , QUEST Nawabshah)

  17. PPT

    Java Inheritance and Polymorphism. Inheritance. Definitions • A class that is derived from another class is called a subclass (also a derived class, extended class, or child class). The class from which the subclass is derived is called a superclass (also a base class or a parent class). Classes can be derived from classes that are derived ...

  18. Presentation of Inheritance in Java

    Presentation of Inheritance in Java.pptx - Free download as Powerpoint Presentation (.ppt / .pptx), PDF File (.pdf), Text File (.txt) or view presentation slides online. The document discusses inheritance in Java. It defines inheritance as a mechanism where a subclass acquires properties and behaviors of a superclass. It describes different types of inheritance like single, multilevel, and ...

  19. Inheritance in Java

    Inheritance in Java.pptx - Free download as Powerpoint Presentation (.ppt / .pptx), PDF File (.pdf), Text File (.txt) or view presentation slides online. Scribd is the world's largest social reading and publishing site.

  20. Inheritance in java

    Inheritance in java. Jul 1, 2017 • Download as PPT, PDF •. 1 like • 919 views. Lovely Professional University. Inheritance in java is a mechanism in which one object acquires all the properties and behaviors of parent object. The idea behind inheritance in java is that you can create new classes that are built upon existing classes. Read ...

  21. Solved This project will give you practice using and

    This project will give you practice using and understanding inheritance and polymorphism in Java. Specifically, you will be designing several classes that will create characters in a game called Critters, developed at the University of Washington by Stuart Reges and Marty Stepp. Each class you'll write will extend a superclass named Critter.

  22. PPT

    Inheritance in Java. An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Download presentation by click this link.