Skip to content

Commit b9522a3

Browse files
committed
4-B-4
1 parent 1f01569 commit b9522a3

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

ch04/DemoMath.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
public class DemoMath
2+
{
3+
public static void main(String[] args)
4+
{
5+
int a = -5;
6+
int b = 7;
7+
double ab = 1.2;
8+
9+
System.out.println("A): " + a);
10+
System.out.println("A demo: " + Math.abs(a));
11+
12+
System.out.println("B): " + b);
13+
System.out.println("B demo: " + Math.max(a, b));
14+
15+
System.out.println("C): " + ab);
16+
System.out.println("C demo: " + Math.pow(ab, ab));
17+
18+
System.out.println("D): " + Math.PI);
19+
20+
}
21+
}

0 commit comments

Comments
 (0)