Question: Java Find the error 1.) public class MyClass { private int x; private double y; public static void setValues(int a, double b) { x =
Java
Find the error
1.)
public class MyClass { private int x; private double y; public static void setValues(int a, double b) { x = a; y = b; } }
2.)
//Assume the following declaration exists :
enum Coffee { MEDIUM, DARK, DECAF }
// This code has errors! Coffee myCup = DARK; switch (myCup) { case Coffee.MEDIUM : System.out.println(Mild flavor.); break; case Coffee.DARK : System.out.println(Strong flavor.); break; case Coffee.DECAF : System.out.println(Wont keep you awake.); break; default: System.out.println(Never heard of it.); }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
