class bow{
int a;
void prit(){
System.out.println("a's number is "+a);
}
}
public class one{
bow b=new bow();
}
能编译过
而
class bow{
int a;
System.out.println("a's number is "+a);
}
public class one{
bow b=new bow();
}不能通过编译,这是为什么呢?
int a;
void prit(){
System.out.println("a's number is "+a);
}
}
public class one{
bow b=new bow();
}
能编译过
而
class bow{
int a;
System.out.println("a's number is "+a);
}
public class one{
bow b=new bow();
}不能通过编译,这是为什么呢?
解决方案 »
- freemarker简单语法问题但是没用过所以问问大家啊。55555
- 各位帮忙看一段简单的代码,if语句部分
- 使用就jacob操作word文件时 如何将文件路径改为相对路径
- 关于JAVAMAIL的发送问题
- 求Java语法练习工具!
- 又一程序发布问题
- 关于用java程序压缩jar
- 怎么jre1.4.2_03 windows xp装不上?
- 高分寻求扩展DefaultTableModel的例子,我都快发疯了。
- 请问在dos窗口下用java命令执行程序,怎样把参数放进命令行,好像是-D参数,但具体怎么写?
- 关于构造方法的问题??????????
- 怎么判断jcombobox的actionlislistener是通过鼠标点击而触发的
class bow{
int a;
static
{
System.out.println("a's number is "+a);
}
}
int a;
static
{
System.out.println("a's number is "+a);
}
}
或
class bow{
int a;
{
System.out.println("a's number is "+a);
}
}
总之只要放代码块中就能编译通过
但是为什么呢?