0
Java code problems
public class MyClass{ public int DollarsCost(String carModel){ if(carModel == "BMWX6") this.price = 100000; if(carModel == "AUDIA8") this.price = 250000; if(carModel == "MERCEDES-BENZAMG63S") this.price = 200000; else this.price = defaultPrice; } private int price; private const int defaultPrice = 0; } Don't pay attention to whole code, just wanted to ask about this line: private const int defaultPrice = 0; How do i write it correctly in java?
2 Respuestas
+ 3
do you mean a constant int?
private final int GREAT_LETTERS = 0;
+ 1
private final int default_price = 0