This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
package foo; public class Outer public static class Inner Which statement true? a. An instance of the Inner class can be constructed statement with "new Outer.Inner()" b. An instance of the Inner class can't be constructed outside of package foo c. An instance of the Inner class can only be constructed from within the Outer class d. From within the package bar, an instance of the Inner class can be constructed statement with "new Inner()" ans : a) but Why is b incorrect? Isnt b true since tha package statement is declared??
thank you for your reply I tried to compile your coding but for some reason it didnt work. I throws NoClassDefFoundException Let me just make sure if I understood right. So the answer choice B would be incorrect from my original question right?? since you CAN create instance outside package b importing the file. How about if you remove the import statement from your subclass? Then it wouldnt work?