Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

R & H Mock Exam Q  RSS feed

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question asks if following code will compile and run:
1. class TestThread3 extends Thread {
2. public void run() {
3. System.out.println("Running");
4. System.out.println("Done");
5. }
6.
7. private void xxx() {
8. System.out.println("In xxx");
9. }
10.
11. public static void main(String args[]) {
12. TestThread3 tt3 = new TestThread3();
13. ttt.xxx();
14. ttt.start();
12. }
13. }
According to R&H Mock exam, this will compile and run. However it will not.
 
Ranch Hand
Posts: 1070
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you say it won't? What kind of error are you seeing?
Bill
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is probably a typo, because the compiler complains about the varible ttt. (tt3 is the onlu instance of TestThread3)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!