Write a program to find out area of rectangle and area of triangle using by abstract class with output
Answers
Answered by
0
Answer:
A class that is declared using “abstract” keyword is known as abstract class. It can have abstract methods(methods without body) as well as concrete methods (regular methods with body). ... An abstract class can not be instantiated, which means you are not allowed to create an object of itAs I said it's not possible because once you create an abstract method inside a class, as per Java specification the class automatically becomes an abstract class. ... But, yes, you can declare static methods on both final class as well as abstract classes, there is no problem with that.
Answered by
0
Answer:
==============================================
- A class that is declared using “abstract” keyword is known as abstract class. It can have abstract methods(methods without body) as well as concrete methods (regular methods with body). ... An abstract class can not be instantiated, which means you are not allowed to create an object of it.
- As I said it's not possible because once you create an abstract method inside a class, as per Java specification the class automatically becomes an abstract class. ... But, yes, you can declare static methods on both final class as well as abstract classes, there is no problem with that.
==============================================
[i hope help ✔️
Similar questions