forked from AndrewProgramming/JavaTutorialCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIntegerDemo.java
More file actions
26 lines (18 loc) · 775 Bytes
/
IntegerDemo.java
File metadata and controls
26 lines (18 loc) · 775 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
package objectandclass;
public class IntegerDemo {
public static void main(String[] args) {
System.out.println(Integer.MAX_VALUE);
System.out.println(Integer.MIN_VALUE);
System.out.println(new Integer(10).compareTo(new Integer(11)));
System.out.println(new Integer(10).compareTo(new Integer(10)));
System.out.println(new Integer(10).compareTo(new Integer(9)));
Integer o1 = Integer.valueOf("12");
System.out.println(o1 == 12);
System.out.println("==============");
System.out.println(Integer.parseInt("11"));
System.out.println(Integer.parseInt("11", 2));//3
System.out.println(Integer.parseInt("11", 8));
System.out.println(Integer.parseInt("13", 10));
System.out.println(Integer.parseInt("1A", 16)); //26
}
}