package com.youku.paycenter.admin.subGate.service.impl; import java.io.UnsupportedEncodingException; import java.util.regex.Matcher; import java.util.regex.Pattern; public class TestString { public static final String CHINESE_REG_EXP =
一、格式化日期和時間 舉例: public void formatDateTime(){ DateFormat format = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss"); Date date = new Date(); System.out.println(format.format(date)); } 結果:2016年03月02日 14:13:08
問題: 使用java進行編程時,有時會發現在一個類中明明定義的是private類型,結果卻能夠在其他類中被修改。 代碼: class Employee{private String name;private double salary;private Date hireDay;public Date getHireDay(){return hireDay;}} Employee harry = new Employee("harry",
1.menu實體類 package recursion;/** * Created by tl on 2016/4/10. */public class Menu { private String id; private String name; private String pid; public String getId() { return id; } public void setId(String id) {
// IntelliJ API Decompiler stub source generated from a class file // Implementation of methods is not availablepackage java.lang;public class Object { public Object() { /* compiled code */ } private static native void registerNatives();
package sort;import java.util.Random;public class HeapSort { public static int SIZE = 10; public static class Heap { public int[] array; public int size; public Heap(int[] array) { super(); this.array