• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

littlesuccess

  • 博客园
  • 联系
  • 订阅
  • 管理

公告

2011年10月19日

怎样删除一个集合中的对象

摘要: 问题:请问下面的那种方法能正确地把字符"B"从集合stringList中删除掉?1 List<String> stringList = new ArrayList<String>();2 stringList.add("A");3 stringList.add("B");4 stringList.add("C");5 stringList.add("B");6 stringList.add("D");7 stringList.add("E&q 阅读全文

posted @ 2011-10-19 18:08 littlesuccess 阅读(581) 评论(0) 推荐(0)

非同步方法能立刻看到同步方法的修改吗?

摘要: 问题:有一个类Foo如下:public class Foo{ private int i = 0; public void f(){ System.println("In f() i=" + i); } public synchronized void g(){ //point 1 System.println("In g() i=" + i); i = 1; //point 2 System.println("In g() i=" + i); }}请问如果有两个线程A,B,线程B执行到point 2时,问线程A总会打印出" 阅读全文

posted @ 2011-10-19 11:13 littlesuccess 阅读(147) 评论(0) 推荐(0)

 
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3