您的位置:程序门 -> java -> j2se / 基础类



java 基础问题!在线等待!


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


java 基础问题!在线等待!
发表于:2007-04-01 09:38:04 楼主
//test10.java     d:\
class   test10{
public   int   a;
public   int   b;


}
//此时不能被当前目录下的其他类引用
  /*class   a{
public   int   a;
public   int   b;


}*/

//test11.java     d:\
class   b{
public   static   a   m=new   a();
c   c=new   c();
int   v;
public   static   void   main(string   args[]){
         
          b.yinonga();
}
public   static   void   yinonga(){

m.b=9;
system.out.println(m.a+ "   "+m.b);

}
}


如果此类想不经import直接使用当前目录下的其他类
那么其他那个类必须保证类名与文件名一致才可以
是这样么?


快速检索

最新资讯
热门点击