Question: Suppose: intx, y; String S1, S2, S3; System.out.print(Enter an integer:); x = keyboard.nextInt(); System.out.print(Enter a word:); S1 = keyboard.next(); S2 = dog; What is wrong
Suppose:
intx, y;
String S1, S2, S3;
System.out.print(Enter an integer:);
x = keyboard.nextInt();
System.out.print(Enter a word:);
S1 = keyboard.next();
S2 = dog;
What is wrong with each of the following:
S2 = ((x == 0) : zero ? non-zero);
y = ((x < 0) ? negative : non-negative);
y = ((S1 == true) ? (x*10) : (x*20));
S3 = ((true == false) ? S1 : S2);
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
