class cricket{
void bat(){
System.out.println("sachin");
}
public static void main(String ar[]){
cricket cricket=new cricket();
cricket.bat();
}
}
输出: 萨钦创建对象
对象名称是一样的name..how它possible..the程序是否给出正确output.wt的原因是类?
谢谢你给出一个清晰易懂的答案.. – 2011-04-07 15:29:22