Question: What is the value of each output statement? Please write your answers on the provided line. public class Evaluation { public static void main (

What is the value of each output statement? Please write your answers on the provided line.
public class Evaluation {
public static void main(String arg[)){
i n t Y=lS, i f (y>10)
Z=20; System.out.println("Union"); System.out.println("Westfield");
else
//10. The output of the above if statement:
if .(.Z==10/I l)y>10) System.out.printl_n("Dallas"), else Sys~out.println(."Houston"),; //11. The output of the above if statement:
if (z==10{&&;y>10) System.out.println("Harrison");
else Syste~ut.println("Kearny");
//12. The output of the above if statement: --------
int[] list={7,3,9,13}; System.out.println(list[2)); .//13._______
System.out.println(list.length); //14.________
int a=2; switch (a){
case 1: System.out.println("Dog");
case 2: System.out:println("cat"); break; case 3: System:out.println("Tiger"); default: System. out'. println( "Animal");
}
//15. The output of the above switch statement: ------- System.out.println(45/10); //16.______ System.out.~~intln(2-2*2); //17.______ System.out.println(2+1*2+1*(2+1)-1); //18.______ System.out.println(fun(3,2)); //19.______ System.out.println(fun(6.2,4.5)); //20._____
}
static int fun(int m, int n){ return (m+n); }
static Stdng fun(double m, int n){ return "Farm"; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!