This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Java in General and the fly likes Multithreading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Multithreading " Watch "Multithreading " New topic


aryan sahu

Joined: Oct 12, 2011
Posts: 11

hello i am a new bie , i am having confusion regarding threads. Do the codes imply the same thing.

Harsha Smith
Ranch Hand

Joined: Jul 18, 2011
Posts: 287
The first code won't compile
John Jai

Joined: May 31, 2011
Posts: 1776
In the first code you are trying to mark the overridden instance method to static - so you get the compile time error.

This behavior is common when you implement an interface or extend a super class.

Have a look at the table in the Summary section of this tutorial -

As you see the error you get is 'static methods cannot hide the instance method in the super class / interface'.
I agree. Here's the link:
subject: Multithreading
jQuery in Action, 3rd edition