// 注册 jvm 关闭时操作
Runtime.getRuntime().addShutdownHook(new Thread(){ public void run() {
System.out.println("关闭"); } });
分类:
其他好文 时间:
2014-06-06 21:54:11
阅读次数:
241
日期的默认输出格式为:Tue Jun 03 19:30:08 CST
2014。问题:如果调整输出的格式。 public static void fun1() { Date date = new Date();
System.out.println(date.toString());} 使用正则表达...
分类:
其他好文 时间:
2014-06-06 17:27:41
阅读次数:
278
Hello, world 类似于脚本语言,下面的代码即是一个完整的 Swift 程序。1
println ("Hello, world")变量与常量 Swift 使用var声明变量,let声明常量。1 var myVariable = 422
myVariable = 503 let myCon.....
分类:
其他好文 时间:
2014-06-06 08:25:46
阅读次数:
240
1 import java.text.*; 2 public class Gxjun 3 { 4
public static void main(String args[] ) 5 { 6 int n=123456789; 7
System.out.println("整数"+"按千分组号(带正好.....
分类:
编程语言 时间:
2014-06-04 17:55:19
阅读次数:
203
package com.saic.grape.controller;
public class Data {
private int j=0;
/**
* 加法
*/
public synchronized void inc() {
j++;
System.out.println("inc 加法运算>>"+j);
}
/**
* 减法
*/...
分类:
编程语言 时间:
2014-06-04 14:03:01
阅读次数:
356
基本概念
注:这一节的代码源自The Swift Programming Language中的A Swift Tour。
Hello, world
类似于脚本语言,下面的代码即是一个完整的Swift程序。
println("Hello, world")
变量与常量
Swift使用var声明变量,let声明常量。
var myVariable = 42 myVariabl...
分类:
其他好文 时间:
2014-06-04 13:18:43
阅读次数:
343
longtime=System.currentTimeMillis(); System.out.println(time); SimpleDateFormatformat=newSimpleDateFormat("yyyy-MM-ddHH:mm:ss"); java.util.Dated1=newDate(time); Stringnow=format.format(d1); System.out.println(now); longt=0; try{ java.util.Dated2=format.pa..
分类:
移动开发 时间:
2014-06-04 12:51:10
阅读次数:
474
/*通过直接预分区的方式建表*/private static void
printTableRegion(String tableName)throws IOException{ System.out.println("Prtint
region of table:"+tableName);/...
分类:
其他好文 时间:
2014-06-03 14:51:05
阅读次数:
207
查看自己电脑已安装的Jdk的位数的方法:
public class ShowJdkBit {
public static void main(String[] args) {
String arch = System.getProperty("sun.arch.data.model");
System.out.println(arch + "-bit");
}...
分类:
其他好文 时间:
2014-06-02 12:30:19
阅读次数:
155
1. matches() 匹配全部Pattern p =
Pattern.compile("reg");Matcher m =
p.matcher("String");System.out.println(m.matches());2:(matches
和find不要一起用,用reset()吐出来)...
分类:
编程语言 时间:
2014-06-02 10:19:32
阅读次数:
390