forked from bitcocom/JavaTPC
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTPC39.java
More file actions
36 lines (30 loc) · 941 Bytes
/
TPC39.java
File metadata and controls
36 lines (30 loc) · 941 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
public class TPC39 {
public static void main(String[] args) {
int a=1;
Integer b=new Integer(1); // Boxing
System.out.println(b.intValue()); // 1
System.out.println(b.toString()); // "1"
Object[] obj=new Object[3];
// 1, 2, 3
/*
* obj[0]=new Integer(1); obj[1]=new Integer(2); obj[2]=new Integer(3);
*/
obj[0]=1;
obj[1]=2;
obj[2]=3;
System.out.println(obj[0]);
System.out.println(obj[1]);
System.out.println(obj[2]);
// "100"+"100"=200
String x="100";
String y="100";
//System.out.println(x+y); // "100100"
int v1=Integer.parseInt(x);
int v2=Integer.parseInt(y);
System.out.println(v1+v2); // 200
// 100+100="100100"
String s1=String.valueOf(v1);
String s2=String.valueOf(v2);
System.out.println(s1+s2); // "100100"
}
}