0
   

where "this" refers to if there are not attributes defined in the class Test1?

 
 
Reply Sat 5 May, 2012 01:57 pm
public class Test1 implements Runnable {
// private Test1 task; // toimii myös ilman attribuutin määrittämistä
public static void main(String[] args) {
Test1 test1 = new Test1(); // luodaan konstruktorin avulla olio test1
}

public Test1() {
// luo säikeen ja käynnistää sen. Mihin tuo this viittaa?
// se viittaa oletus
new Thread(this).start();
}

public void run() {
System.out.println("test ");
}
}

question: where "this" refers to if there are not attributes defined in the class Test1?
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Question • Score: 0 • Views: 728 • Replies: 0
No top replies

 
 

Related Topics

 
  1. Forums
  2. » where "this" refers to if there are not attributes defined in the class Test1?
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 04/16/2024 at 04:24:11