This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Protected members in a protected static inner class

 
See Furst
Greenhorn
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

and



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.

Thanks,
See.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic