public void Write(Log log){
List logs = new ArrayList();
logs.add(log);
bufferLogs.ForceEnqueue(logs);
if(BaseAdapter!=null && bufferLogs.getCount()>=Size)
{
for(int i=bufferLogs.getCount();i>=0;i--)
{
logs.addAll(bufferLogs.Dequeue());
}
BaseAdapter.Write(logs);
}
}
public void Write(Log log){
bufferLogs.ForceEnqueue(logs);
if(BaseAdapter!=null && bufferLogs.getCount()>=Size)
{
List<Log> logs = new ArrayList<Log>();
for(int i=bufferLogs.getCount();i>=0;i--)
{
logs.addAll(bufferLogs.Dequeue());
}
BaseAdapter.Write(logs);
}
}
你的第二个,错误很明显,就是你的logs是在if语句里面定义的,而你在bufferLogs这儿却用到了,所以有错
private CircularQueue> bufferLogs = new CircularQueue >();
bufferLogs 的类型是> Write 方法里面参数类型为Log. 问下第二段代码的第一条出应该怎么改?
第一种和第二中的差别是什么? 我用第一种 老师说不对 要用第二种 但有错误 类型的那里 让我自己去想 实在找不到啊