Java program to create an abstract class with a static method
All Answers
total answers (1)
Severity: 8192
Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
Filename: libraries/Filtered_db.php
Line Number: 23
total answers (1)
Program/Source Code:
The source code to create an abstract class with a static method is given below. The given program is compiled and executed successfully.
Output:
Explanation:
In the above program, we created an abstract class AbsClass with a static method MyFun(). Then we will inherit the AbsClass into the Main class.
The Main class contains a method main(). The main() method is the entry point for the program, here we called MyFun() method using the AbsClass and printed the result.