Re: problem with multithreading
Firstly, you might want to download the latest java version 6 (
This has no bearing on the original problem.
Secondly I would recommend Eclipse IDE ( http://www.eclipse.org/ ).
Although you could try netbeans, and maybe jCreator.
If you cannot write a class that compiles with emacs or vi, then you cannot
write one in any IDE either. The IDEs at the initial stages of learning will
likely hinder learning rather than help it.
Otherwise you might find yourself configuring the IDE all the time instead of
Gordon is spot on with the mistakes.
You might also run into another trouble with the main method. This can
be solved by placing your main method code into "public extendthread( )
" constructor and calling it.
Terrible idea! Do not follow this advice!
Main method code should go inside the main(), not the constructor.
Constructors exist to construct instances of a class; that's why they're
called "constructors". The main() method is there to run the main function of
the class, that's why it's called "main()". Do not follow the advice to put
significant class functionality into a constructor - it is a really, really
You should name your class with an initial upper-case letter, and
"extendthread [sic - should be ExtendThread]" is a very weak name. It embeds a
keyword ("extends") in the name, which could be invalidated if, say, you
changed the class from "extends Thread" to "implements Runnable" after
refactoring. Object-oriented programming involves *hiding* implementation
details, not including them in the nomenclature.
Methods and variables should be named with lower-case initial letters. Each
subsequent word part in a name should begin with an upper-case letter. Example:
public class SomethingToDoSomething
private int internalVariable;
private String yetAnotherVariable;
public void nowHereIsAMethod() ...