Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Abstract class in Java 5 or previous

I've read in a book ( Programmez en Java 5 et 6 by Claude Delannoy, in French) that in Java 5 and its previous versions, if you have an abstract method in a class then this class is abstract and it's not necessary to mention the keyword abstract before the class.

Is this statement true? I tried to find the Java SE 5 specification but it's unreachable.

like image 688
Abdelilah Aassou Avatar asked Jan 07 '23 06:01

Abdelilah Aassou


1 Answers

If you want to make a class abstract,you need to declare it abstract no matter which version of java you are using.

If a class contains an abstract method,then that class also becomes abstract and you need to declare that class abstract to resolve compile issue.

like image 185
Prince Avatar answered Jan 15 '23 03:01

Prince