
JAVA
文章平均质量分 74
topboy8381
none
展开
-
利用正则表达式进行校验
字符描述: ^符号匹配字符串的开头。 例如:^abc 与"abc xyz"匹配,而不与"xyz abc"匹配。 $符号匹配字符串的结尾。 例如:abc$ 与"xyz abc"匹配,而不与"abc xyz"匹配。 注意:如果同时使用^符号和$符号,将进行精确匹配。例如:^abc$ 只与"abc"匹配。 *符号匹配0个或多个前面的字符。原创 2005-08-24 00:18:00 · 619 阅读 · 0 评论 -
HashMap
HashMap把各个Object映射起来,实现了“键--值”对应的快速存取。 一个 HashMap 的实际容量就 因子*容量,其默认值是 16×0.75=12; 这个很重要,对效率很一定影响!当存入HashMap的对象超过这个容量时,HashMap 就会重新构造存取表。反正,如果你已经知道你大概要存放多少个对象,最好设为该实际容量的能接受的数字。 两个关原创 2005-08-25 00:05:00 · 884 阅读 · 0 评论 -
各类排序算法java的实现
插入排序:package org.rut.util.algorithm.support;import org.rut.util.algorithm.SortUtil;public class InsertSort implements SortUtil.Sort{ /* (non-Javadoc) * @see org.rut.util.algorithm.SortUtil.Sort#sort原创 2006-04-23 16:10:00 · 670 阅读 · 0 评论 -
ArrayList中的数据排序--java对象排序
这次项目遇到数组排序的问题.比如我有一个Person类,它的实例对象存储在ArrayList数组中,现在要把ArrayList数组中的Person对象按照年龄排序.其实这种情况经常遇到.下面给出源代码:1:Person.java文件:-------------------------------public class Person{ String name; int age; public原创 2007-01-08 16:13:00 · 1049 阅读 · 0 评论 -
java学习-IO(Files)
Determining If a File or Directory Exists boolean exists = (new File("filename")).exists(); if (exists) { // File or directory exists } else { // File or directory doe原创 2007-04-11 16:52:00 · 876 阅读 · 0 评论 -
java学习-IO(Filenames and Pathnames)
Constructing a Filename PathA File object is used to represent a filename. Creating the File object has no effect on the file system; the filename need not exist nor is it created. On Windows, thi原创 2007-04-11 16:47:00 · 631 阅读 · 0 评论