-2

I know that a Java class can have one parent class (extends) and implement some interfaces (implements). Is there a limit in the number of interfaces that a class can implement?

Guido
  • 46,642
  • 28
  • 120
  • 174

1 Answers1

2

I redirect you here and the answer of @Jivings:

How much interfaces a class file can implement

From the Java VM Specification on Limitations of the JVM:

The number of direct superinterfaces of a class or interface is limited to 65535 by the size of the interfaces_count item of the ClassFile structure.

That is the only limitation. And it is due to the structure of the compiled Java bytecode.

shareeditflag

edited Jul 30 '16 at 16:55

Laurel 4,57992136

answered Jun 14 '12 at 13:28

Jivings 18.5k44283