Skip to main content
added 34 characters in body
Source Link
user128807
  • 10.6k
  • 17
  • 56
  • 74

I'm using a static analyzer in Eclipse to examine my code. One class, foo, has an inner class, bar. I am getting the following error:

JAVA0043 Inner class 'bar' does not use outer class 'foo' 

Why is this an error? As long as the outer class uses the inner class isn't that sufficient to make this information hiding useful and correct?

The inner class is not static.

I'm using a static analyzer in Eclipse to examine my code. One class, foo, has an inner class, bar. I am getting the following error:

JAVA0043 Inner class 'bar' does not use outer class 'foo' 

Why is this an error? As long as the outer class uses the inner class isn't that sufficient to make this information hiding useful and correct?

I'm using a static analyzer in Eclipse to examine my code. One class, foo, has an inner class, bar. I am getting the following error:

JAVA0043 Inner class 'bar' does not use outer class 'foo' 

Why is this an error? As long as the outer class uses the inner class isn't that sufficient to make this information hiding useful and correct?

The inner class is not static.

Source Link
user128807
  • 10.6k
  • 17
  • 56
  • 74

What is wrong with an inner class not using an outer class in Java?

I'm using a static analyzer in Eclipse to examine my code. One class, foo, has an inner class, bar. I am getting the following error:

JAVA0043 Inner class 'bar' does not use outer class 'foo' 

Why is this an error? As long as the outer class uses the inner class isn't that sufficient to make this information hiding useful and correct?