`
chasewade
  • 浏览: 14301 次
  • 性别: Icon_minigender_1
  • 来自: 湖南
最近访客 更多访客>>
社区版块
存档分类
最新评论
文章列表
//1.新建一个实体类User public class User { String name; Integer age; public User(String name, Integer age) { super(); this.age = age; this.name = name; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer ...
<html> <head> <title>JavaScript RegExp</title> <script type="text/javascript"> /********************** /* var reg = /test/; var str = 'testString'; var result = reg.exec(str); alert(result); */ function execReg(reg,str) { //exec ...
import java.util.ArrayList; import java.util.Collections; public class ListSort { public static void main(String[] args) { ArrayList<Integer> list = new ArrayList<Integer>(); list.add(new Integer(5)); list.add(new Integer(3)); list.add(new Integer(2)); list.add(new I ...
<html> <head> <script type="text/javascript"> function startTime() { var today=new Date() var h=today.getHours() var m=today.getMinutes() var s=today.getSeconds() // add a zero in front of numbers<10 m=checkTime(m) s=checkTime(s) document.getElementById('txt ...
<html> <body> <script type="text/javascript"> var d = new Date() var time = d.getHours() var m = d.getMinutes(); var s = d.getSeconds(); if (m<10) { document.write(time+":0"+m+":"+s); } else { document.write(time+":"+m+":&q ...
/** * 2011-04-26 * @author chase * 字节数组转换为16进制字符串 */ public class BytetoHex { public static final String encodeHex(byte[] bytes) { StringBuffer buf = new StringBuffer(bytes.length * 2); for (int i = 0; i < bytes.length; i++) { if (((int)bytes[i] & 0xff) < 0x10) { ...
使用泛型的类 /** * 使用泛型的类 * @author chase * * @param <T> */ class Gen<T> { private T ob; //定义泛型的成员变量 public Gen(T ob) { this.ob = ob; } public T getOb() { return ob; } public void setOb(T ob) { this.ob = ob; } public void showType() { System. ...

冒泡排序

    博客分类:
  • J2se
public class MaoPao { /** * @param args * @author chase * 冒泡排序 从小到大 */ public static void main(String[] args) { int i,j; int intArray[]={10,5,85,40,20,78,66}; int l=intArray.length; for(i=l-1;i>0;i--) { for(j=0;j<i;j++) { if(intArray[j]>intAr ...
import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * 正则表达式抓取网页的所有邮箱链接 * @author chase * */ public class EmailSpider { public static void main ...
<?xml version='1.0' encoding='utf-8'?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to ...
<Connector port="8088" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding='UTF-8' /> 再Tomcat的安装目录下(apache-tomcat-6.0.18\apache-tomcat-6.0.18\conf\server.xml) 里添加URIEncoding= ...
e100 33 f6 bf 0 20 b5 10 f3 a5 8c c8 5 0 2 50 68 13 1 cb e 1f be a1 1 bf 0 1 e11b 6 57 b8 11 1 bb 21 13 89 7 4b 4b 48 79 f9 ad 86 e0 8b c8 bd ff ff e8 20 e134 0 3d 0 1 74 1a 7f 3 aa eb f3 2d ff 0 50 e8 f 0 5a f7 d8 8b d8 26 8a 1 aa e14f 4a 75 f9 eb de cb 57 bb 21 13 8b c1 40 f7 27 f7 f5 8b fb b ...

泛型方法实例

    博客分类:
  • J2se
/** * * @author chase * 2011-04-26 * 泛型方法实例 * */ public class ExampleA { public <T> void f(T x) { System.out.println(x.getClass().getName()); } public static void main(String args[]) { ExampleA ea = new ExampleA(); ea.f(""); ea.f(23); ea.f(&qu ...
Global site tag (gtag.js) - Google Analytics