What is the result of the following code? (Choose all that a…
What is the result of the following code? (Choose all that apply) 13: String a = ” “; 14: a += 2; 15: a += ‘c’; 16: a += false; 17: if (a == “2cfalse”) System.out.println(“==”); 18: if (a.equals(“2cfalse”)) System.out.println(“eaqals”);
Read DetailsShow the output of the following program when it run from c…
Show the output of the following program when it run from command line using the following command ( line numbers are not a feature of a code) : java Test I have a dream 1: public class Test { 4: for (int i = 0; i < args.length; i++) 7: }
Read DetailsUse a switch statement to rewrite the following if statement…
Use a switch statement to rewrite the following if statement // Find interest rate based on year if (numOfYears == 7) annualInterestRate = 7.25; else if (numOfYears == 15) annualInterestRate = 8.50; else if (numOfYears == 30) annualInterestRate = 9.0; else { System.out.println(“Wrong number of years”); System.exit(0); }
Read Details