基本数据类型
int
long
float
double
boolean
char
final double PI = 3.1415927; 声明常量
double[] myList = new double[size]; 创建一个数组
遍历数组:
for(type element: array) { System.out.println(element); }
for (int i = 1; i < myList.length; i++)
{
System.out.println(myList[i]);
}
ArrayList<ArrayList<Double>> data; 声明
Set<Cluster> clusterSet2;
ArrayList<float[]> Sim_In;
ArrayList<Double> sum = new ArrayList<Double>();
List<Integer> jishu = new ArrayList<Integer>();
ArrayList<Double> sum2 = new ArrayList<Double>();
ArrayList<ArrayList<Double>> Sim_On=new ArrayList<ArrayList<Double>>();
ArrayList<float[]> Sim_All;
DistanceCompute disC2 = new DistanceCompute();
Vector 可实现自动增长的对象数组。
java.util.vector提供了向量类(Vector)以实现类似动态数组的功能。
Vector<String> hs = new Vector<String>(); hs.add("aa"); 循环vector
public void printSet(List hs) { Iterator iterator = hs.iterator(); while (iterator.hasNext()) { System.out.println(iterator.next()); } }