#java | Abstract Class | Telugu | Dr.Venkat | Polymorphism | Method Overriding | Interfaces | Python

preview_player
Показать описание
Abstract Class:

Use of Abstract Methods and Concrete Methods

Link for Super and Sub class Relationship:

Link for Interfaces Concept:

-A class with minimum of one Abstract method (Method with no code).
-Objects cannot be created to an abstract class.
-Reference variables can be created

-Abstract classes can be extended.
-Abstract class provides an template for sub classes which can some common features to sub classes.
-Sub class has a responsibility to implement the abstract methods.

-When all the objects requirement is same we need to go for concrete methods(Methods with code) in an abstract class.
-When every object requirement is different we need to go for abstract methods.


---------------
//Manager
public abstract class Car
{
//Concrete Method
public void fuelTank()
{
}
//abstract methods
public abstract void steering();
public abstract void breaking();
}

//Team member1
public class Maruti extends Car
{
//Overriding the methods
public void steering()
{
}
public void breaking()
{
}
}

//Team member2
public class Santro extends Car
{
//Overriding the methods
public void steering()
{
}
public void breaking()
{
}
}

//main class
public class UseCar
{
public static void main(String args[])
{
Car c1 = new Maruti();

Car c2 = new Santro();
}
}
Рекомендации по теме
Комментарии
Автор

Answer is invalid because we cannot create an object to an abstract class❤ super explanation sir

mohammadowaisahmed
Автор

The explanation quite neat and excellent sir..
Answer : invalid bcoz object cannot be created to an abs.class

VDSHS-lo
Автор

Great Presentation, cleared entire abstract class concept in just 13 min, Mind Blowing. Answer for the question is Invalid

stech-po
Автор

Excellent Teaching Sir.
Ans: Invalid

Abhidmv
Автор

Great doing sir, Please do a video on this keyword in Java. Answer is Invalid. It is not possible to create an object for Interface.
Car c = new Car(); Trying to create an object for interface which is not possible.

vm-vj
Автор

Statement is invalid as objects are not created for abstract classes

kranthisidda
welcome to shbcf.ru