由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - 这个程序为什么先打印hellomyworld,而不是args【0】?
相关主题
一道java题jdbc连接数据库出现的问题
is it legal for the constructor of a REST resource class to throw exceptions?Weblogic 8.1又一个问题---应该是有关JDBC的
who can help me with this dummy Question??新手求助,急急急!!!
折腾了一天,实在是绝望了,请教请教help "java.lang.NoSuchMethodError"
Re: how to initialize corba object orb in servlet不用main(String args[]),怎样输出"hello world"?
java StringRe: 怎样不用main(String args[])输出"hello worl
2 Questions about Constructor请帮忙看看这个编译错误
两个很基本的JAVA问题请教一个简单的问题
相关话题的讨论汇总
话题: string话题: helloworld话题: args话题: person
进入Java版参与讨论
1 (共1页)
m******u
发帖数: 12400
1
class HelloMyWorld {
HelloMyWorld(){
System.out.println("Hello my world!");
}
}
public class HelloWorld {
private String person;
HelloWorld (String person){
this.person = person;
System.out.println(this.person+ new HelloMyWorld());
}

public static void main(String [] args){

new HelloWorld(args[0]);

}
}
z*********e
发帖数: 10149
2
call stack?
Step by step debug can help you understand how it runs
A******e
发帖数: 6
3
Java class initialize sequence is like this: static variables->instance
variables->constructors.
m******u
发帖数: 12400
4
class HelloMyWorld {
HelloMyWorld(){
System.out.println("Hello my world!");
}
}
public class HelloWorld {
private String person;
HelloWorld (String person){
this.person = person;
System.out.println(this.person+ new HelloMyWorld());
}

public static void main(String [] args){

new HelloWorld(args[0]);

}
}
z*********e
发帖数: 10149
5
call stack?
Step by step debug can help you understand how it runs
A******e
发帖数: 6
6
Java class initialize sequence is like this: static variables->instance
variables->constructors.
x*****2
发帖数: 117
7
当执行System.out.println(this.person …… 时需要初始化
HelloMyWorld类,而该类的构造函数中打印输出“Hello my world!”字符串,所以先于
args[0]。

:class HelloMyWorld {
: HelloMyWorld(){
1 (共1页)
进入Java版参与讨论
相关主题
请教一个简单的问题Re: how to initialize corba object orb in servlet
overloading methodsjava String
怎样用class的string type name 动态生成object? 2 Questions about Constructor
简单问题两个很基本的JAVA问题
一道java题jdbc连接数据库出现的问题
is it legal for the constructor of a REST resource class to throw exceptions?Weblogic 8.1又一个问题---应该是有关JDBC的
who can help me with this dummy Question??新手求助,急急急!!!
折腾了一天,实在是绝望了,请教请教help "java.lang.NoSuchMethodError"
相关话题的讨论汇总
话题: string话题: helloworld话题: args话题: person