It's not a secret anymore!*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes java threads Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "java threads" Watch "java threads" New topic

java threads

Asanka Vithanage
Ranch Hand

Joined: Oct 24, 2008
Posts: 59
when i compiled this gives a asanswer
but my answer is can any body give a reson to this out

class B extends Thread{
public void run(){

class A extends B implements Runnable {
public void Run(){

public static void main( String as[]){

A a =new A();
Thread z=new Thread(a);


SCJP 1.5 (94%)
Ankit Garg

Joined: Aug 03, 2008
Posts: 9293

Hi asanka!

In your code the run method in class A is mistyped. It must be run not Run. This is why you are getting wrong output...

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Asanka Vithanage
Ranch Hand

Joined: Oct 24, 2008
Posts: 59
thank you
Don't get me started about those stupid light bulbs.
subject: java threads