KrzAramis Help Me | Yo les amis j ai enfin reussi a faire un thread ! applaudissement svp.
Le probelme c est que ca compile mais que quand je le lance il me fait:
Citation :
java.lang.NoSuchMethodError: main
Exception in thread main
|
je pige pas ?
voila le code
Code :
- import java.net.*;
- import java.io.*;
- import java.util.*;
- import java.lang.*;
- class MultiServer extends Thread
- {
- /*Varialble accessible trought out the all class*/
- static PrintWriter Screen = new PrintWriter(System.out, true);
- public String inp, Request, Row, Column;
- // I) CREATE A CATALOGUE
- String [][]CATALOGUE = { /*X= 0 , 1 , 2 , 3 */
- /*[Y][X]*/ /*Y=0*/{"Item Name", "Item ID", "\tNo Left in Stock", "Time To Deliver"},
- /*Y=1*/{"Baws", "1", "10","5"},
- /*Y=2*/{"Mince", "2", "10","5"},
- /*Y=3*/{"Pies", "3", "10","5"},
- /*Y=4*/{"Tea", "4", "10","5"}
- };
- int X = 3, Y = 4, Item_ID, Quantity;
- public ServerSocket sock;
- public Socket sock1;
-
- public void run()
- {
- try
- {
- /*le boulot que doit faire mon thread */
- }
- catch(IOException err)
- {
- Screen.println(err.getMessage());
- }
- finally
- {
- Screen.println("End of the program" );
- Screen.flush();
- }
- }//end of run
-
- public /*static*/ void main (String[]args) //throws IOException
- {
- try
- {
- sock = new ServerSocket(1111);
- while(true)
- {
- //Communication establishment
- sock1 = sock.accept();
- Thread Task = new MultiServer();
- Task.start();
- }
- }
- catch(IOException err)
- {
- Screen.println(err.getMessage());
- }
- }//end of main
- }//end of class
|
Bon qqn a une expliquation ? |