hulizhong
发贴: 39
积分: 0
|
于 2005-04-17 13:19
package firstword; import java.net.*; import javax.net.*; import java.io.*; public class Communication extends Thread{ int indata ,outdata; char buffer[]=new char[8192]; public Communication() { try{ Socket csocket = new Socket(jTextArea3.getText(),80); BufferedReader in =new BufferedReader(new BufferedInputStream(csocket.getInputStream())); PrintWriter out = new PrintWriter(csocket.getOutputStream()); }catch(IOException e){ } } public void run(){ while(true){ indata =in.read(buffer); if(indata==-1) break; }//end while String indata_s=new String(buffer); jTextArea2.append("服务器端:"+indata); }//end run Communication communication=new Communication(); }
以上是我用JBuilder编写的一部分程序.public class Communication extends Thread. public上一个提示:class Communication is public,should be decleared in a file named Communication.程序中我不是已经说明了是public了吗. 为什么会出现上述警告啊?谢谢解答.
why edited on 2005-04-18 22:08
|