map遍历

来源:互联网 发布:tasty大龙小龙知乎 编辑:程序博客网 时间:2024/06/05 09:29
        for (Map.Entry<?, ?> entry : beans.entrySet())
        {
            String key = (String) entry.getKey();
            String value = (String) entry.getValue().getClass().getName();
            System.out.println("key: "+ key +"   value: " +value);

        }


打印InputStream的内容:

 InputStream in =   
        byte b[]=new byte[2048];     //创建合适文件大小的数组  
        in.read(b);    //读取文件中的内容到b[]数组  
        in.close();  
        System.out.println(new String(b));

原创粉丝点击