Question: Which of the following displays Error when a student ID is less than 1000 or more than 9999? a. if(stuId < 1000) if(stuId > 9999)

Which of the following displays Error when a student ID is less than 1000 or more than 9999?
a. if(stuId < 1000) if(stuId > 9999)
System.out.println("Error");
b. if(stuId < 1000 && stuId > 9999)
System.out.println("Error");
c. if(stuId < 1000)
System.out.println("Error");
else
if(stuId > 9999)
System.out.println("Error");
d. Two of these are correct.

Step by Step Solution

3.32 Rating (164 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

c ifstuId 1000 ... View full answer

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 Java Programming Questions!