- 0
- 0
- 约5.72千字
- 约 19页
- 2017-06-07 发布于湖北
- 举报
* * * * * * * 第21章 Java SE6新功能简介 Java SE6基本新功能 Apache Derby、JDBC 4.0 java.lang套件 在Java SE 6中,String类别上新增了isEmpty()方法 String str = ; if(str.isEmpty()) { … } java.util套件 在Java SE 6中,Arrays类别新增了copyOf()方法 int[] arr1 = {1, 2, 3, 4, 5}; int[] arr2 = Arrays.copyOf(arr1, arr1.length); for(int i = 0; i arr2.length; i++) System.out.print(arr2[i] + ); System.out.println(); int[] arr1 = {1, 2, 3, 4, 5}; int[] arr2 = Arrays.copyOf(arr1, 10); for(int i = 0; i arr2.length; i++) System.out.print(arr2[i] + ); System.out.println(); java.util套件 copyOfRange()方法 binarySearch()方法 int[] arr1 = {1, 2, 3, 4, 5}; int[] arr2 = Arrays.copyOf(arr1, 1, 4); int[] arr1 = {10, 20, 30, 40, 50, 60, 70, 80, 90}; int result = Arrays.binarySearch(arr1, 6, 9, 85); if(result -1) { System.out.printf(索引%d处找到数据%n, result); } else { System.out.printf(插入点%d %n, (result + 1) * -1); } java.util套件 在Java SE 6中,您可以直接使用getDisplayNames()或getDisplayName()方法取得区域化的日期格式显示 Calendar rightNow = Calendar.getInstance(); Locale locale = Locale.getDefault(); System.out.println(现在时间是:); System.out.printf(%s:%d %n, rightNow.getDisplayName(ERA, LONG, locale), rightNow.get(YEAR)); System.out.println( rightNow.getDisplayName(MONTH, LONG, locale)); System.out.printf(%d日%n, rightNow.get(DAY_OF_MONTH)); System.out.println( rightNow.getDisplayName(DAY_OF_WEEK, LONG, locale)); java.io套件 使用System类别上新增的console()方法 使用Console物件的readLine()方法 System.out.print(输入名称:); String name = System.console().readLine(); System.out.print(输入密码:); char[] passwd = System.console().readPassword(); String password = new String(passwd); if(caterpillar.equals(name) 123456.equals(passw
您可能关注的文档
- Java初学 简单课件 第3章 类的封装、继承及多态.ppt
- Java大学实用教程第四讲.ppt
- 极限配合和技术测量课件.ppt
- java的动态绑定和双分派.pdf
- Java第03章--2(对象及类).pdf
- 极小值原理与应用.ppt
- 技能部分第一二篇练习Microsoft Word 文档.doc
- 第八章 Altiris简单安装步骤.pdf
- 检索及推荐中的排序.pdf
- Java第六篇图形界面设计.ppt
- 2025-2026学年天津市和平区高三(上)期末数学试卷(含解析).pdf
- 2025-2026学年云南省楚雄州高三(上)期末数学试卷(含答案).pdf
- 2025-2026学年甘肃省天水市张家川实验中学高三(上)期末数学试卷(含答案).docx
- 2025-2026学年福建省厦门市松柏中学高二(上)期末数学试卷(含答案).docx
- 2025-2026学年广西钦州市高一(上)期末物理试卷(含答案).docx
- 2025-2026学年河北省邯郸市临漳县九年级(上)期末化学试卷(含答案).docx
- 2025-2026学年河北省石家庄二十三中七年级(上)期末历史试卷(含答案).docx
- 2025-2026学年海南省五指山市九年级(上)期末化学试卷(含答案).docx
- 2025-2026学年河北省唐山市玉田县九年级(上)期末化学试卷(含答案).docx
- 2025-2026学年河北省邢台市市区九年级(上)期末化学试卷(含答案).docx
最近下载
- 原调正谱G小小蝴蝶la farfalletta钢琴伴奏高清打印版.pdf VIP
- 上海大学2024-2025学年第1学期《高等数学(上)》期末考试试卷(B卷)附参考答案.pdf
- 广发证券-交通银行-601328-零售转型提速,定增落地夯实资本根基.pdf
- 上海大学2024-2025学年第1学期《高等数学(上)》期末考试试卷(A卷)附参考答案.pdf
- 循环系统护理小讲课.pptx
- 建筑屋面西瓦专项施工方案(范本).doc VIP
- 2024年山东铝业职业学院单招综合素质考试题库及答案1套.docx VIP
- 探究TIPS术后支架堵塞的影响因素及抗凝治疗的必要性:基于多维度分析与临床实践.docx
- 成品仓库出货明细表.pdf VIP
- 贵州省黔西南州2025年中考数学试卷及答案.pdf VIP
原创力文档

文档评论(0)