Question: Consider the following method. public static void whatIsIt ( int a , int b ) { if ( ( a < b ) && (

Consider the following method.
public static void whatIsIt(int a, int b)
{
if ((a < b) && (a >0))
{
System.out.println("W");
}
else if (a == b)
{
if (b >0)
{
System.out.println("X");
}
else if (b <0)
{
System.out.println("Y");
}
else if ((a == b) && (a ==0))
{
System.out.println("Z");
}
}
}
Which of the following method calls will cause "W" to be printed?
whatIsIt(10,10)
whatIsIt(-5,5)
whatIsIt(7,10)
Responses
I only
I only
II only
II only
III only
III only
I and III
I and III
II and III

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!