1
public class MaxVariables
2

{
3
public static void main(String[] args)
4
{
5
byte largestByte=Byte.MAX_VALUE;
6
short largestShort=Short.MAX_VALUE;
7
int largestInteger=Integer.MAX_VALUE;
8
long largestLong=Long.MAX_VALUE;
9
float largestFloat=Float.MAX_VALUE;
10
double largestDouble=Double.MAX_VALUE;
11
char aChar='S';
12
boolean aBoolean=true;
13
14
System.out.println("最大的byte值是:"+largestByte);
15
System.out.println("最大的short值是:"+largestShort);
16
System.out.println("最大的integer值是:"+largestInteger);
17
System.out.println("最大的long值是:"+largestLong);
18
System.out.println("最大的float值是:"+largestFloat);
19
System.out.println("最大的doubble值是:"+largestDouble);
20
if(Character.isUpperCase(aChar))
21
{
22
System.out.println("字符"+aChar+"是大寫字母");
23
}
24
else
25
{
26
System.out.println("字符"+aChar+"是小寫字母");
27
}
28
System.out.println("布爾型變量的值是"+aBoolean);
29
}
30
}

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
