在java中使用静态内部类的目的一般是为了把一个类隐藏在另一个类中或者是为了防止在一个大项目中多个类的重名.当然也只有内部类才能被声明为static的,比如:
class ABC{                        ............                        public static class BankAccoutn{//静态内部类                        ...........                        }                        ...........                        public static BankAccount Test(){//类ABC中的静态方法                        ...........                       }                        ..........}
为了使外部用户看不到类BankAccount或者避免有别的类与BankAccount重名,把BankAccout声明为static的,比如:
public class TestABC{                              public static void main(String[] arg){                              ABC.BankAccount  newabc=ABC.Test();//使用静态内部类                              ..............                              }                              ..............}
这样就到达了目的!