public static int getCommand(byte[] bytes){
String command=new String(bytes).trim();
return getCommand(command);
}
返回语句这么是写怎么解释?
String command=new String(bytes).trim();
return getCommand(command);
}
返回语句这么是写怎么解释?
解决方案 »
- login.do转到UserLoginAction.java然后在UserLoginAction中通过topicList.do找到TopicListAction
- 关于java工厂方法设计模式的问题
- 运行时刻如何获得某个方法调用其他方法的调用层次树?
- 帮忙看看这个程序??是什么问题??
- 可否用xml配置文件,然后动态生成界面?
- 这个模式怎么设计?
- 请问调用notify后被选中线程的wait是立刻返回,还是等到调用notify的线程退出synchronized块后再返回?
- 做通信有谁用过AdventNet吗,请帮忙?
- 请问如何将一个类中定义的所有的String变量一一取出?
- Free Java的初始设置问题----初学者求教.
- 发布一个使用Java开发拾取屏幕颜色的小工具
- java 处理音频的问题
public static int getCommand(String command){
int comm=0;
int start=command.indexOf('<');
if(start==0){
int end=command.indexOf('>');
command=command.substring(start+1,end);
if(command.equalsIgnoreCase("login")){
comm=1;
}
if(command.equalsIgnoreCase("list")){
comm=2;
}
if(command.equalsIgnoreCase("get")){
comm=3;
}
if(command.equalsIgnoreCase("help")){
comm=4;
}
if(command.equalsIgnoreCase("quit")){
comm=10;
}
if(command.equalsIgnoreCase("ok")){
comm=101;
}
}
return comm;
}
}
第一个方法返回的什么
至于方法里的处理,就是为了严谨吧。