int i = 123;int j = i;i = 55;
employee e = new employee("fred");employee f = e;f.name = "barney";
int value = 123;object o = value; // 将 int 包装到对象中int value2 = (int) o; // 解除包装到 value2
long value2 = (long) o; // 包装的值是 int
long value2 = (long)(int) o;
// 方案 1int total = 35;datetime date = datetime.now;string s = string.format("your total was {0} on {1}", total, date);// 方案 bhashtable t = new hashtable();t.add(0, "zero");t.add(1, "one");// 方案 cdatetime d = datetime.now;string s = d.tostring();// 方案 ivint[] a = new int[2];a[0] = 33; // 方案 101arraylist a = new arraylist();a.add(33);// 方案 vimystruct s = new mystruct(15);iprocess ip = (iprocess) s;ip.process();
新闻热点
疑难解答