Skip to content
Advertisement

How correct to make (move) the class internal in Java?

Structure of my project is:

JavaScript

Code ActionCalculateQuadrangle.interface:

JavaScript

Code Line.class:

JavaScript

Part of code unity-class ‘CalculateQuadrangle.class` (I cite part of the code so as not to clutter up the place):

JavaScript

That’s ok. But A want to make class ‘Line’ internal.

How I do it? Like this:

JavaScript

But compiler java show me error like this – Class 'CalculateQuadrangle' must either be declared abstract or implement abstract method 'getLengthLine(Line)' in 'ActionCalculateQuadrangle'.

  1. Declarate abstract – can’t for me.
  2. implement abstract method ‘getLengthLine(Line)’ in ‘ActionCalculateQuadrangle’. That mean, what i must implement ALL abstract method, which have in the argument object class Line.

enter image description here

How correct to make (move) the class internal?

After update still have error: enter image description here enter image description here

Advertisement

Answer

The error you are seeing is because you now have two Line classes, and the method definition and interface definition are not referring to now the same class of CalculateQuadrangle.Line

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement