aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Threads Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Threads" Watch "Threads" New topic
Author

Threads

Srinivasa Gundapu
Greenhorn

Joined: Jan 10, 2003
Posts: 10
public class Tux extends Thread{
static String sName = "vandeleur";
public static void main(String argv[]){
Tux t = new Tux();
t.piggy(sName);
System.out.print(sName);
}
public void piggy(String sName){
sName = sName + " wiggy";
start();
}
can anyone tell me the output of this program i am pasting the code for reference.and explain
public void run(){
for(int i=0;i < 4; i++){ sName = sName + " " + i; } }}
1) Compile time error
2) Compilation and output of "vandeleur wiggy"
3) Compilation and output of "vandeleur wiggy 0 1 2 3"
4) Compilation and probably output of "vandeleur" but possible output of "vandeleur 0 1 2 3"


Srinivas
Sridhar Srikanthan
Ranch Hand

Joined: Jan 08, 2003
Posts: 366
Srinivas,
You can check this
link
HTH
Sri
Jasper Vader
Ranch Hand

Joined: Jan 10, 2003
Posts: 284
Srinivasa - i guess you've been to examulator.com recently too eh? !


giddee up
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Threads