1.What output is produced by the following code?
int time = 2, tide = 3;
if (time + tide > 6)
System.out.println("Time and tide wait for no one.");
else if (time + tide > 5)
System.out.println("Time and tide wait for someone.");
else if (time + tide > 4)
System.out.println("Time and tide wait for everyone.");
2. What output is produced by the following statements?
int number = 7;
boolean isPositive = (number > 0);
if (number > 0);
number = −100;
if (isPositive) System.out.println("Positive."); else System.out.println("Not positive."); System.out.println(number);
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here