Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visualizing Health And Healthcare Data Creating Clear And Compelling Visualizations To See How Youre Doing

Authors: Katherine Rowell ,Lindsay Betzendahl ,Cambria Brown

1st Edition

1119680883, 978-1119680888

More Books

Students also viewed these Databases questions