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.
相关文档:
public boolean writeXML(String content, String filename)
{
String savepath;
FileOutputStream fout;
// log.info("content:"+content+ ......
transient是Java语言的关键字,用来表示一个域不是该对象串行化的一部分。当一个对象被串行化的时候,transient型变量的值不包括在串行化的表示中,然而非transient型的变量是被包括进去的!
public class User implements Serializable{
private static final long serialVersionUID = 1L;
private Integer id;
......
方法的重载
:同一个类里面方法的名字相同,方法的参数项(主要是参数类型,参数个数)
不同
,
返回类型可能不同。
重载方法可以具有不同的返回类型,但返回类型本身不足以区分方法的两个版
本。 ......
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 ......
抽象类就是不能使用new方法进行实例化的类,即没有具体实例对象的类。抽象类有点类似“模板”的作用,目的是根据其格式来创建和修改新的类。对象不能由抽象类直接创建,只可以通过抽象类派生出新的子类,再由其子类来创建对象。当一个类被声明为抽象类时,要在这个类前面加上修饰符abstract。
&nbs ......