![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java
文章平均质量分 52
java_wd
这个作者很懒,什么都没留下…
展开
-
数组间复制值
如果要将一个数组的值复制到另一个数组,可以使用system 的一个静态方法 arraycopy() static void arraycopy(Object src,int srcPos,Object dest,int destPos,int length)arraycopyt() 方法参数说明src: 源数组srcPos: 源数组中的起始位置dest: 目标数组destP原创 2013-05-17 17:05:08 · 570 阅读 · 0 评论 -
java IP地址与数字之间的转换
/** * 字符串ip转换为long * @param 字符串ip * @return */ public static long getStringIpToLong(String ip) { String[] ips = ip.split("[.]"); long num =原创 2013-03-25 09:27:45 · 1064 阅读 · 0 评论 -
java字符串的排列组合
String str = "safdvs"; char[] arr1 = str.toCharArray(); char[] arr2 = Arrays.copyOf(arr1,arr1.length); for(int i=0;i for(int j=i+1;j System.out.println(arr1[i]+","+arr2[j]); }原创 2013-03-25 09:14:56 · 931 阅读 · 0 评论 -
java 加载解析properties 文件
/** * * TODO 描述 * 加载解析 properties * @param * @return void * @throws * */ public Properties ParseProperties(){ String s_path="config.properties"; // 生成输入流 Inp原创 2013-03-25 10:08:58 · 546 阅读 · 0 评论 -
java生成随机不重复的四位数
String[] beforeShuffle = new String[] { "2", "3", "4", "5"}; List list = Arrays.asList(beforeShuffle); Collections.shuffle(list); StringBuilder sb = new Stri原创 2013-03-25 09:10:06 · 5168 阅读 · 1 评论 -
java本地时间与UTC时间相互转换
DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); try { Date date = format.parse("2013-03-20 17:47:09"); System.out.println(date); //转换为U原创 2013-03-25 09:12:47 · 12177 阅读 · 0 评论 -
java double float 精度计算
//加法运算 public static double add(double v1, double v2){ BigDecimal b1 = new BigDecimal(Double.toString(v1)); BigDecimal b2 = new BigDecimal(Double.toString(v2)); retu原创 2013-05-17 14:55:07 · 719 阅读 · 0 评论 -
java 解析txt,conf 文件
@SuppressWarnings("unchecked") public String[] readfile(String filepath) throws Exception { FileReader fr = new FileReader(filepath); // 将无法识别的字节赋值为'?' int c = 63; String errmessage = "文原创 2013-03-25 09:19:40 · 3033 阅读 · 0 评论 -
linux ant 自动打包
--> includeantruntime="false" nowarn="on" source="1.6" target="1.6" deprecation="true" debug="true" encoding="UTF-8" classpathref="project.classpath原创 2013-04-01 09:39:10 · 819 阅读 · 0 评论 -
成员变量和局部变量的区别
1. public,private,static,protect可以修饰成员变量,不可以修饰局部变量,两者都可以使用final修饰2. 成员变量存在堆内存中,局部变量存在栈内存中3.成员变量可以不用赋初始值,局部变量必须赋初始值4.成员变量在整个类中可见,局部变量在某个方法内可见原创 2013-05-17 15:28:57 · 512 阅读 · 0 评论