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

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!