Java
DragonFangQy
努力做最适合的那一个
展开
-
Java学习笔记之 Flie方法(一)
// 判断目录或者文件是否可操作public boolean canExecute() api: Tests whether the application can execute the file denoted by this abstract pathname. On some platforms it may be possible to start the Java virtua原创 2015-05-08 08:22:13 · 810 阅读 · 0 评论 -
java学习笔记之StringBuffer(二)
StringBuffer buffer = new StringBuffer("abcdefg"); // delete(int start, int end) // 删除start 到 end-1位置的字符,并返回一个stringbuffer StringBuffer charAt = buffer.delete(1, 2); System.out.println(c原创 2015-04-30 18:10:58 · 357 阅读 · 0 评论 -
java学习笔记之String 构造方法
// string 的都构造 String() String str = new String(); // string 的都构造 String(byte[] bytes) byte[] b = { '1', '7', '9', 'a', }; str = new String(b); // string 的都构造 String(byte[] bytes, Charset原创 2015-04-28 17:09:16 · 401 阅读 · 0 评论 -
java学习笔记之String的方法
String str = "AwoDeCSDN"; // charAt(int index) // 返回指定index 位置的字符, char charAt = str.charAt(5); // codePointAt(int index) // 返回指定index 位置的字符的Unicode 编码 int codePointAt = str.codePointAt(原创 2015-04-29 09:40:13 · 513 阅读 · 0 评论 -
java学习笔记之StringBuffer(一)
// StringBuffer(); StringBuffer buffer = new StringBuffer(); System.out.print(buffer + " 0\t"); // StringBuffer(CharSequence seq) buffer = new StringBuffer("abc"); System.out.print(b原创 2015-04-30 14:19:27 · 366 阅读 · 0 评论 -
Java学习笔记之 File构造方法
未做任何操作的电脑 E:\Test,如下图 开始// File(String pathname) '\\'为了转义'\'// 通过抽象路径pathname 创建一个新的文件或者目录 File parent = new File("E:\\Test\\aa");// exists 判断文件或目录是否存在;存在为true if(!parent.exists()原创 2015-05-07 21:05:18 · 5490 阅读 · 0 评论 -
Java学习笔记之 Flie方法(二)
电脑 E:\Test // hashCode() 得到哈希码 File file = new File(“E:\Test”); int hashCode = file.hashCode(); System.out.println(hashCode);结果: // isAbsolute() 判断 file的路径是不是绝对路径 File file = ne原创 2015-05-21 09:24:28 · 420 阅读 · 0 评论