Home arrow static arrow Java Programming [Archive] - Compile time error at hand!!!
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - Compile time error at hand!!!
This topic has 2 replies on 1 page.

Posts:60
Registered: 3/30/04
Compile time error at hand!!!  
Aug 7, 2004 1:30 AM



 

public class processServerOutput extends Thread implements Runnable {   Socket socket;  public processServerOutput() {  }    processServerOutput(Socket s) {      socket=s;    }      void run () {      String ServerOutput;      try {        InputStream is = socket.getInputStream();        InputStreamReader isr2 = new InputStreamReader(is);        BufferedReader br2 = new BufferedReader(isr2);          while ((ServerOutput = br2.readLine())!=null) {          System.out.println("["+ServerOutput+"]");          }          } catch ( Exception e) {}      } }


I get the following errors

run() in client_demo.pocessServerOutput cannot implement run() in java.lang.Runnable; attempting to assign weaker privileges; was public at line [..,..]
run() in client_demo.processServerOutput cannot override run() in java.lang.Thread; attempring to assign weaker privileges; was public at line [..,..]

Anyone any idea???

gr. Razorblade
 

Posts:11,186
Registered: 06.04.04
Re: Compile time error at hand!!!  
Aug 7, 2004 1:33 AM (reply 1 of 2)



 
I get the following errors

run() in client_demo.pocessServerOutput cannot implement run() in java.lang.Runnable; attempting to
assign weaker privileges; was public at line [..,..]
run() in client_demo.processServerOutput cannot override run() in java.lang.Thread; attempring to
assign weaker privileges; was public at line [..,..]

Anyone any idea???

Yes, the public Runnable interface declares a public run method; you're trying to implement
this method without supplying public access for it; i.e. you're trying to 'weaken' the access privileges.

kind regards,

Jos
 

Posts:60
Registered: 3/30/04
Re: Compile time error at hand!!!  
Aug 7, 2004 1:39 AM (reply 2 of 2)



 
found the solution already. thx any way
 
This topic has 2 replies on 1 page.