on 09-21-2006 8:06 AM
Hello ! i a begginner in java..kindly help me in solving these questions.
wat'll happen when u compile and run this code?
public class Bground extends Thread{
public static void main(String argv[]){
Bground b=new Bground();
b.run();
}
public void start(){
for(int i= 0;i<10;i++){
System.out.println("Value of i=" + i);
}
}
}
Options----
1. A compile time error indicating that no run method is defined for the Thread class
2.A run time error indicating that no run method is defined for the Thread class
3.Clean compile and at run time the values 0 to 9 are printed out
4. Clean compile but no output at runtime
hi Payal,
Sorry, the correct option is 4 not 3.
Clean compile and nothing will be printed.
Regards,
Richa.
Message was edited by: Richa Singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.