• Post Reply Bookmark Topic Watch Topic
  • New Topic

Protected members in a protected static inner class  RSS feed

Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok I came across an interesting dilema and was wondering if anyone could answer it.

This is probably not good practice and you would never do it.. but for an intellectual exercize

Lets say I have the following class in a package com.thing.mine:

Now how would a class outside the com.thing.mine package access the members of the static inner class?

Here are some attempts which came up with compiler errors

access error


access error

also this one for kicks

Also gave, to my surprise, an access error istead of a class not found error... According to convention com.thing.mine.StaticInner.SimpleConstants should be in com/thing/mine/StaticInner/SimpleConstats.java.. but I get an access error... That would certainly have my head banging against a wall for hours. Is that even to spec?

Anyway let me know what other stuff you all may find.


  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!