public class Triangle { static double area; int b = 2, h = 3;
public static void main(String[] args) { double p, b, h; // line n1 if (area == 0) { b = 3; h = 4; p = 0.5; } area = p * b * h; // line n2 System.out.println("Area is " + area); } }
public class Test { public static void main(String[] args) { // line n1 switch (x) { case 1: System.out.println("One"); break; case 2: System.out.println("Two"); break;
} } }
Which three code fragments can be independently inserted at line nl to enable the code to print one?
A. Byte x = 1; B. short x = 1; C. String x = "1"; D. Long x = 1; E. Double x = 1; F. Integer x = new Integer ("1");