This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
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 REST with Spring (video course) this week in the Spring 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: 9453

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
Consider Paul's rocket mass heater.
subject: java threads
jQuery in Action, 3rd edition