生活随笔
收集整理的這篇文章主要介紹了
常用API-String、包装类、System
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
?
import?java.io.IOException;?import?java.util.Arrays;??public?class?fuxi2_string_system_baozhuanglei?{?????public?static?void?main(String[]?args)?????{???????????????????????????String?newstr;?????????String?str?=?"?Iloveyou";?????????newstr?=?str.trim();?????????newstr?=?str.toUpperCase();?????????newstr?=?str.toLowerCase();?????????newstr?=?str.substring(1);?????????newstr?=?str.substring(5,8);?????????newstr?=?String.valueOf(87899);?????????newstr?=?str.concat("fff");?????????System.out.println(newstr);??????????????????boolean?bs?=?str.startsWith("i");?????????bs?=?str.endsWith(".doc");??????????bs?=?str.contains("h");?????????bs?=?str.isEmpty();?????????char?c?=?str.charAt(6);?????????int?p?=?str.indexOf("co");?????????p?=?str.lastIndexOf('o');?????????p?=?str.indexOf('v',?3);?????????p?=?str.length();??????????????????System.out.println(p);??????????????????String[]?array?=?str.split("o");?????????System.out.println(Arrays.toString(array));??????????????????????????????????boolean?f?=?false;?????????Boolean?ff?=?new?Boolean(f);?????????boolean?fz?=?Boolean.parseBoolean("TRue");?????????fz?=?ff.booleanValue();??????????????????char?ch?=?'5';?????????Character?cha?=?new?Character(ch);?????????boolean?bc?=?cha.isDigit(ch);?????????bc?=?Character.isUpperCase('D');?????????char?cz?=?cha.charValue();??????????????????int?in?=?Integer.MAX_VALUE;?????????in?=?Integer.parseInt("568512");?????????????????????????for?(int?i?=?0;?i?<?10;?i++)?????????{?????????????System.out.println(i);?????????}?????????System.exit(1);???????????????????????????Runtime?run?=?Runtime.getRuntime();?????????try?????????{?????????????run.exec("C:/Program?Files?(x86)/Tencent/QQ/Bin/QQ.exe");?????????}?????????catch?(IOException?e)?????????{?????????????e.printStackTrace();?????????}???????????????????System.arraycopy();????????????Runtime.getRuntime().exec("D:\\Program?Files\\SDK?Setup.exe");???????????????????????}?}?
轉載于:https://blog.51cto.com/glblong/1186829
總結
以上是生活随笔為你收集整理的常用API-String、包装类、System的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。