Motivation of the change(Defects of Packages)
• Package names are hierarchical
• Package membership is not hierarchical
> A type defined in package P.Q is not in package P
• Package visibility is not hierarchical
> Code in P.Q cannot access package-visible members in P
• Result: Too much is declared public
Superpackages
• Aim: Language-level modules, independent of
deployment mechanism
super package java {
member java.util;
member java.io;
member sun misc; // Impl detail
export java.util.*;// Public API
export java.io.*;
}
No comments:
Post a Comment