201707-17 JSONArray JSON数组 NameJSONArray JSON数组ExamplesString[] species = { "Capra hircus", "Panthera pardus", "Equus zebra" }; String[] names = { "Goat", "Leopard", "Zebra" }; JSONArray values; void setup() { values.... Read More >
201707-17 IntList整数型列表类 Name IntList整数型列表类 Examples IntList inventory; void setup() { size(200, 200); inventory = new IntList(); inventory.append(84); inventory.append(15); .... Read More >
201707-17 IntDict整数型字典类 NameIntDict整数型字典类ExamplesIntDict inventory; void setup() { size(200, 200); inventory = new IntDict(); inventory.set("cd", 84); inventory.set("tapes", 15); inventory.set("records", 102); .... Read More >
201707-17 HashMap散列映射 NameHashMap散列映射Examplesimport java.util.Map; // Note the HashMap's "key" is a String and "value" is an Integer HashMap<String,Integer> hm = new HashMap<String,Integer>(); // Putting ke.... Read More >
201707-17 FloatList浮点型列表类 NameFloatList浮点型列表类ExamplesFloatList inventory; void setup() { size(200, 200); inventory = new FloatList(); inventory.append(108.6); inventory.append(5.8); inventory.append(8.2); println.... Read More >
201707-17 FloatDict浮点型字典类 Name FloatDict浮点型字典类 Examples FloatDict inventory; void setup() { size(200, 200); inventory = new FloatDict(); inventory.set("coffee",108.6); inventory.se.... Read More >
201707-16 ArrayList动态数组 NameArrayList动态数组Examples// These are code fragments that show how to use an ArrayList. // They won't compile because they assume the existence of a Particle class. // Declaring the ArrayList, note .... Read More >
201707-16 Array数组 NameArray数组 Examplesint[] numbers = new int[3]; numbers[0] = 90; // Assign value to first element in the array numbers[1] = 150; // Assign value to .... Read More >
201707-16 long长整数 Namelong长整数 Exampleslong a; // Declare variable 'a' of type long and assign a large value: //a = 2147483648; // Error: The literal of type int is out of range a = 2147483648L; // Instead, .... Read More >
201707-15 int整数 Nameint整数 Examplesint a; // Declare variable 'a' of type int a = 23; // Assign 'a' the value 23 int b = -256; // Declare variable 'b' and assign it the value -256 int c = a + b; /.... Read More >
201707-15 float浮点数 Namefloat浮点数 Examplesfloat a; // Declare variable 'a' of type float a = 1.5387; // Assign 'a' the value 1.5387 float b = -2.984; //.... Read More >
201707-15 double双精度浮点型 Namedouble双精度浮点型 Examplesdouble a; // Declare variable 'a' of type float a = 1.5387; // Assign 'a' the value 1.5387 double b = -2.984; // Declare variable 'b' and assign it the .... Read More >
201707-15 color颜色 Namecolor颜色 Examples color c1 = color(204, 153, 0); color c2 = #FFCC00; noStroke(); fill(c1); rect(0, 0, 25, 100); fill(c2); rect(25, 0, 25, 1.... Read More >
201707-15 char字符 Name Char字符 Examples char m; // Declare variable 'm' of type char m = 'A'; // Assign 'm' the value "A" int n = '&'; // Declare variable 'n' and assign it the val.... Read More >
201707-15 byte字节 Name Byte字节 Examples // Declare variable 'a' of type byte byte a; // Assign 23 to 'a' a = 23; // Declare variable 'b' and assign it the value -128 byt.... Read More >
201707-15 boolean布尔值 Name Boolean布尔值 Examples boolean a = false; if (!a) { rect(30, 20, 50, 50); } a = true; if (a) { line.... Read More >