易截截图软件、单文件、免安装、纯绿色、仅160KB

Java Network Game Programming

game
server responsibility:
Initialize
the server socke;

Wait
for a client to connect;

Accept
the client connection;

Create
a daemon thread to support the clien;

Go
back to step 2.

game daemon responsibility:
Accept
client player connection;

Pair
up players to form separate game;

Manage
the flow of the game;
Communicate
each player's move to the other player;
Notify
the players of the state of the game.



相关文档:

JAVA中FileHelper的一个用法

 public boolean writeXML(String content, String filename)
    {  
        String savepath;
        FileOutputStream fout;
//        log.info("content:"+content+ ......

JAVA transient 关键字

transient是Java语言的关键字,用来表示一个域不是该对象串行化的一部分。当一个对象被串行化的时候,transient型变量的值不包括在串行化的表示中,然而非transient型的变量是被包括进去的!
public class User implements Serializable{
private static final long serialVersionUID = 1L;


private Integer id; ......

Java 复习笔记_第1天

 
方法的重载
:同一个类里面方法的名字相同,方法的参数项(主要是参数类型,参数个数)
不同
,
返回类型可能不同。
      
  
        
重载方法可以具有不同的返回类型,但返回类型本身不足以区分方法的两个版
本。 ......

java读取xml

package test;
import java.io.*;
import javax.xml.parsers.*;
import org.w3c.dom.*;
import org.xml.sax.SAXException;
public class XmlTest {
 public static void main(String[] args) {
  File xmlFile=new File("test/xml.xml");
  DocumentBuilderFactory documentBuilderFactor ......

java抽象类和抽象方法

抽象类就是不能使用new方法进行实例化的类,即没有具体实例对象的类。抽象类有点类似“模板”的作用,目的是根据其格式来创建和修改新的类。对象不能由抽象类直接创建,只可以通过抽象类派生出新的子类,再由其子类来创建对象。当一个类被声明为抽象类时,要在这个类前面加上修饰符abstract。
  &nbs ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号