我有一个看起来像这样的事情:
User user = userDao.Get(1);
do
{
// processing
// get the next user
//
user = UserDao.GetNext(user.Id);
if(user == null)
continue; // will this work?????????????
}
while ( user != null)
如果它确实有效,它将转到 do 语句的顶部,并且 user 为空,所以事情会中断吗?
也许我应该将循环重新编写为 while 语句?