Interface may contain only abstract methods.why this statement is false | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Interface may contain only abstract methods.why this statement is false

?

8th Jul 2019, 7:43 AM
Rohit Ahuja
Rohit Ahuja - avatar
2 Answers
+ 1
I think because of the word "may". It would mean that an Interface can have also non abstract methods. But an interface can have only abstract methods. https://www.google.de/amp/s/www.geeksforgeeks.org/difference-between-abstract-class-and-interface-in-java/amp/
8th Jul 2019, 2:05 PM
Denise Roßberg
Denise Roßberg - avatar
0
Java can have non abstract methods . They are default methods and static interface methods. I believe they were introduced in Java 8 or 9
9th Jul 2019, 2:45 AM
Stanley ice
Stanley ice - avatar