Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ private InventoryAuditApp() {

public static void main(String[] args) {
final Double[] unitPrices = {
new Double(19.99),
new Double(4.50),
new Double(120.00),
new Double(7.25)
Double.valueOf(19.99),
Double.valueOf(4.50),
Double.valueOf(120.00),
Double.valueOf(7.25)
};
final Boolean[] inStock = {
new Boolean(true),
new Boolean(false),
new Boolean(true),
new Boolean(true)
Boolean.valueOf(true),
Boolean.valueOf(false),
Boolean.valueOf(true),
Boolean.valueOf(true)
};
final Character[] grades = {
new Character('A'),
new Character('C'),
new Character('B'),
new Character('A')
Character.valueOf('A'),
Character.valueOf('C'),
Character.valueOf('B'),
Character.valueOf('A')
};

double totalValue = 0.0;
Expand All @@ -46,10 +46,10 @@ public static void main(String[] args) {
}

public static Double calculateAverageValue(double totalValue, int itemCount) {
return new Double(totalValue / itemCount);
return Double.valueOf(totalValue / itemCount);
}

public static Integer countAvailableItems(int totalItems, int outOfStockItems) {
return new Integer(totalItems - outOfStockItems);
return Integer.valueOf(totalItems - outOfStockItems);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ private OrderRollupApp() {

public static void main(String[] args) {
final Integer[] boxCounts = {
new Integer(4),
new Integer(7),
new Integer(3),
new Integer(5)
Integer.valueOf(4),
Integer.valueOf(7),
Integer.valueOf(3),
Integer.valueOf(5)
};
final Long[] orderValues = {
new Long(1299L),
new Long(2450L),
new Long(875L),
new Long(1625L)
Long.valueOf(1299L),
Long.valueOf(2450L),
Long.valueOf(875L),
Long.valueOf(1625L)
};

int totalBoxes = 0;
Expand All @@ -32,12 +32,12 @@ public static void main(String[] args) {
}

public static Integer calculatePackingUnits(int boxesPerOrder, int orderCount) {
return new Integer(boxesPerOrder * orderCount);
return Integer.valueOf(boxesPerOrder * orderCount);
}

public static Long estimateShippingCents(long baseCents, int boxCount) {
final Long perBoxCents = new Long(baseCents);
final Long totalCents = new Long(perBoxCents.longValue() * boxCount);
return new Long(totalCents.longValue());
final Long perBoxCents = Long.valueOf(baseCents);
final Long totalCents = Long.valueOf(perBoxCents.longValue() * boxCount);
return Long.valueOf(totalCents.longValue());
}
}
Loading