比如下面的这个程序
public class ConcurrentHelloWorld extends Thread{ @Override
public void run() {
// TODO Auto-generated method stub
super.run();
for(int i = 0; i < 10;i++)
System.out.println("hello world " + i + Thread.currentThread().toString());
}
public ConcurrentHelloWorld(){
super();
} /**
* @param args
*/
public static void main(String[] args) {
Thread thread = new Thread(new ConcurrentHelloWorld());
thread.start(); }}
super();是做干什么的?
super("String"); 有是干撒的啦?
public class ConcurrentHelloWorld extends Thread{ @Override
public void run() {
// TODO Auto-generated method stub
super.run();
for(int i = 0; i < 10;i++)
System.out.println("hello world " + i + Thread.currentThread().toString());
}
public ConcurrentHelloWorld(){
super();
} /**
* @param args
*/
public static void main(String[] args) {
Thread thread = new Thread(new ConcurrentHelloWorld());
thread.start(); }}
super();是做干什么的?
super("String"); 有是干撒的啦?
解决方案 »
- Java实现自动登录网站发帖
- IO问题----自己模拟的以行为单位读取记事本里的内容
- 请教 java 输出流和C# 输出流 写入 byte 数组的问题
- 计算器 结果栏溢出处理应该用什么方法?
- eclipse
- JDeveloper10 中使用的问题
- 做打开文件,可实现出来效果执行的特别慢,为什么
- removeAll不起作用?怎样更新?
- 怎样才能运行java 程序
- inputstream 生成多个文件?
- 请问double heightofyou=1.83;是非法字符?
- 求助:Error opening egistrykey'software\javasoft\java runtime enviro
super("String");调用父类一个参数的构造方法,并将参数传给父类。
哥哥 这个super是我自己加上去的 不是编译器加的
我知道这个方法调用的是
public Thread() {
init(null, null, "Thread-" + nextThreadNum(), 0);
}然后再调用 Thread.init();这个 private void init(ThreadGroup g, Runnable target, String name,
long stackSize) 谁可以帮我解释下啊 到底调用和不调用有什么区别啊