;-)
larf.

That'd be the one

Tref Gare
Web Developer MCSD/SCJP
eCommerce Group
Phone:  (03) 9221 4106
Mobile: 0409 556 478
Fax:    (03) 9941 4295

> -----Original Message-----
> From: Ronald Wildenberg [SMTP:[EMAIL PROTECTED]]
> Sent: Monday,14 January 2002 6:27
> To:   [EMAIL PROTECTED]
> Subject:      Re: A java question.
>
> I suppose that you mean:
> Rule No. 999 in Java: if you have more than one class per source file, ...
>
>
> Chen Chao wrote:
>
>       Rule No. 1 in Java: if you have more than one class in your
> application, you only can use "public" key word in the class which has
> main method (public static void main( ) ...).  Try the following code and
> name your file as Test2.java (not Test.java):
>
>       class Test implements Runnable {    // remove public key word here
>       public void run() {
>       for (int i=1; i<=10; i++){
>       System.out.println("Test:"+i);
>       }
>       }
>       }
>
>       public class Test2 {   // add public keyword here if you want to
>
>       public static void main (String args[]){
>
>        Test te = new Test();
>        Thread t = new Thread(te);
>        t.start();
>
>       }
>       }
>
>
>       Compile Test2.java and run it:
>
>       C:\>java Test2
>
>
>       Cheer.
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to