作者:gnuhpc 出處:http://www.cnblogs.com/gnuhpc/1.簡介: 以前你想讓程式記住使用者自訂的習慣,比如介面字型等,你使用一個設定檔,但是在維護多個使用者或出現誤拼字時還是力不從心。而java.util.prefs包則提供了便利。線上文檔寫的非常糟糕,將java.util.prefs這個類描述為“a node in a hierarchical collection of preference data”,還說“there are two
作者:gnuhpc 出處:http://www.cnblogs.com/gnuhpc/import java.util.Vector; public class CollectionOne { public static void main(String arg[]) { new CollectionOne(); } CollectionOne() { Vector<Object>
作者:gnuhpc 出處:http://www.cnblogs.com/gnuhpc/在Java中,要定義常量的話,可以在類中使用 public static final 。。。。 比如: public static final int PI = 3.14159;//java.lang.Math.PI差不多就應該是這麼定義的。 再比如: public static final int NAME
作者:gnuhpc 出處:http://www.cnblogs.com/gnuhpc/// Create a Comparator that returns the outcome // of a reverse string comparison. class RevStrComp implements Comparator<String> { // Implement the compare() method so that it //
作者:gnuhpc 出處:http://www.cnblogs.com/gnuhpc/1.聲明數組引用變數時不能指定數組的長度。如:int x[1];這句話非法。2.數組對象的建立,例如:int [] scores = new int[100];首先在堆中分配記憶體空間,上述的就是400個位元組,然後就給其賦預設值,各個資料類型的預設值不同,int為0.3.返回數組對象的引用:int [] x =new int [10]; <=> int size = 10; int []
作者:gnuhpc 出處:http://www.cnblogs.com/gnuhpc/// This Comparator uses a Collator to determine the// proper, case-insensitive lexicographical ordering// of two strings.class IgnoreCaseComp implements Comparator<String> { Collator col;