Abstract Class in Java
Abstract Class in Java
2
www.wscubetech.com
Ways to achieve Abstraction
3
www.wscubetech.com
Abstract class in Java
b) An abstract class can not be instantiated, which means you are not
allowed to create an object of it.
4
www.wscubetech.com
Why we need an abstract class?
5
www.wscubetech.com
Points to Remember
6
www.wscubetech.com
abstract class
7
www.wscubetech.com
abstract method
A method which is declared as abstract and does not have implementation is known as an abstract
method.
abstract void demo(); //no method body and abstract
It's important to note that, only an abstract class can contain abstract methods. If we include
abstract methods inside a class that is not abstract, we will get an error.
An abstract class can contain both abstract and non-abstract methods. Here's an example.
8
www.wscubetech.com
Understanding the real scenario of Abstract class
Thank You
https://www.facebook.com/wscubetech.india https://www.linkedin.com/company/wscube-tech
https://plus.google.com/+wscubetechjodhpur https://www.youtube.com/c/wscubetechjodhpur
https://twitter.com/wscube