MathThings

This commit is contained in:
2024-09-16 08:15:02 +02:00
parent 71f10f2644
commit 2c715a1d0e
2 changed files with 24 additions and 0 deletions

View File

@ -61,5 +61,29 @@ public class Main {
System.out.println("Movie: " + ticket.getMovie());
System.out.println("Row: " + ticket.getRow());
System.out.println("Seat: " + ticket.getSeat());
//The Math class:
int a = Math.abs(10);
System.out.println(a);
int b = Math.abs(-20);
System.out.println(b);
double c = Math.ceil(7.342);
System.out.println(c);
double f = Math.floor(7.343);
System.out.println(f);
int m = Math.max(10, 20);
System.out.println(m);
int m1 = Math.min(10, 20);
System.out.println(m1);
double p = Math.pow(2, 3);
System.out.println(p);
}
}