Question: 18. lastname1122 What will be printed by the following code segment? String firstname = Bill, lastname = Gates; System.out.printin(lastname +11+22 ); 19. Pi has the
18. lastname1122 What will be printed by the following code segment? String firstname = "Bill", lastname = "Gates"; System.out.printin("lastname" +11+22 ); 19. Pi has the value 3.14. What will be printed by the following code segment? float pi =3.14159; System.out.printf("Pi has the value %5.2f."pi); 20. // my name or / m my name */ Comment lines may be used in a Java program to improve readability. Write a comment line to include your full name in it. 21. infinite In a for ... loop, it is allowed for the condition part be omitted. If there is no condition then the body of the loop will be executed for. times. 22. AlabamaState What will be printed if x has the value 5 ? switch (x) f case 5: System.out.print("Alabama"); case 4: System.out.print("State"); break; case 2: System.out.print("University"); break; case 1: System.out.print("Go"); default: System.out.print("Hornets"); \} 23. 42 In the loop below, how many times "Java" will be printed? for (x=7;x>1;x=) for (y=1;y11) System.out.print(" x is just right" ); else if (x!=0)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
