J2ME的类方面的问题
请问各位大侠,我在书上看到了这样的一个类
public class Index {
private String key;//这里的KEY就是name
private int recordID;
public Index(){}
public void setKey(String key){
this.key=key;
}
public void setRecordID(int recordID){
this.recordID=recordID;
}
public byte[]serilize()throws IOException{
ByteArrayOutputStream baos=new ByteArrayOutputStream();
DataOutputStream dos=new DataOutputStream(baos);
dos.writeUTF(key);
dos.writeInt(recordID);
dos.close();
baos.close();
return baos.toByteArray();
}
public Index deserilize(byte[] data) throws IOException{
ByteArrayInputStream bais=new ByteArrayInputStream(data);
DataInputStream dis=new DataInputStream(bais);
Index index=new Index();
index.key=dis.readUTF();
index.recordID=dis.readInt();
dis.close();
bais.close();
return index;
}
}
然后在一个方法看到了
public Index[] searchIndex(String key){}
这里的 Index[]是指的什么啊?
public class Index {
private String key;//这里的KEY就是name
private int recordID;
public Index(){}
public void setKey(String key){
this.key=key;
}
public void setRecordID(int recordID){
this.recordID=recordID;
}
public byte[]serilize()throws IOException{
ByteArrayOutputStream baos=new ByteArrayOutputStream();
DataOutputStream dos=new DataOutputStream(baos);
dos.writeUTF(key);
dos.writeInt(recordID);
dos.close();
baos.close();
return baos.toByteArray();
}
public Index deserilize(byte[] data) throws IOException{
ByteArrayInputStream bais=new ByteArrayInputStream(data);
DataInputStream dis=new DataInputStream(bais);
Index index=new Index();
index.key=dis.readUTF();
index.recordID=dis.readInt();
dis.close();
bais.close();
return index;
}
}
然后在一个方法看到了
public Index[] searchIndex(String key){}
这里的 Index[]是指的什么啊?
...全文
相关推荐
j2ME KXml2 解决找不到类的问题 多送点分也值了
解决了j2me上使用kxml包找不到类的问题(ClassNotFoundException),找了好久好久,好不容易找到了,源码直接引入即可,绝对值10分呀
j2me随机数问题
j2me随机数问题的详解
j2me移植到android的代码封装
Image、Font、Graphics等类的封装
NIIT sm4 mt2 j2me
NIIT sm4 mt2 j2me 80多页的题目! 这是汇总版,题目比其他版本多很多!
快速转化J2ME程序为Android程序
近年来伴着Android智能手机的迅速崛起,如何迅速移植已有的J2me应用到Android让其发挥余力,便成了开发人员急于解决的问题,借助本文档你可以非常快速地将原J2ME应用转化为APK应用。还等什么,马上行动吧....


J2ME
