-
Notifications
You must be signed in to change notification settings - Fork 151
Expand file tree
/
Copy pathMain.java
More file actions
30 lines (23 loc) · 834 Bytes
/
Main.java
File metadata and controls
30 lines (23 loc) · 834 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
package com.ironhack;
import java.math.BigDecimal;
import java.math.RoundingMode;
public class Main {
public static void main(String[] args) {
double num1;
BigDecimal num = new BigDecimal("7.9421");
BigDecimal number = new BigDecimal("25.7589");
BigDecimal displayVal = num.setScale(2, RoundingMode.HALF_EVEN);
BigDecimal reversed = number.negate().setScale(1, RoundingMode.HALF_EVEN);
System.out.println(displayVal);
System.out.println(reversed);
Truck mahmud = new Truck("99ME786","nese","Opel",100,89.3);
System.out.println(mahmud.getInfo());
Movie nese = new Movie ("The Martian",1,6.7);
nese.getInfo();
System.out.println(nese.getInfo());
IntArrayList abc = new IntArrayList();
abc.add(5);
abc.add(6);
abc.get(0);
}
}