Create prototype

Report a typo

Please, create an instance of PrototypeIPhone154 and invoke method printMinCost.

public class IPhone154 {

    static double minCost = PriceBook.PrototypeIPhone154; // lookup a value from an external price book

    static class PrototypeIPhone154 {

        void printMinCost() {
            System.out.println("The min cost of IPhone154 should be: $" + minCost);
        }
    }
}
Write a program in Java 17
public class Main {
public static void main(String[] args) {
// write your code
}
}

// An internal staff of the testing platform. Do not change it
class IPhone154 {
static double minCost = initCost();

static class PrototypeIPhone154 {
void printMinCost() {
System.out.println("The min cost of IPhone154 should be: $" + minCost);
}
}

private static double initCost() {
java.util.Scanner scanner = new java.util.Scanner(System.in);
return scanner.nextDouble();
}
}
___

Create a free account to access the full topic