Question: Question 41 Consider the following code snippet: int score = 0; double price = 100; if (score > && price 10) { System.out.println(buy); } Which



Question 41 Consider the following code snippet: int score = 0; double price = 100; if (score > && price 10) { System.out.println("buy"); } Which of the following statements is true on the basis of this code snippet? The output is buy. The code snippet compiles and runs, but there is no output. The code snippet doesn't compile. The code snippet causes a divide-by-zero error. Question 42 Assume the following variables have been declared and given values as shown: int i = 2345; double m = 67.8; What will be printed by the statement below? System.out.printf("Values are %1ed and %7.2f", i, j); Values are 2345 and 67.8 Values are 2345 and 67.80 Values are %100 and %7.2f 2345 67.8 Values are %1ed and %7.2f ij Question 43 What is the name of the = operator in Java? inequality O assignment o identity equality Question 44 0.4 points We want to change the BankAccount class so that all accounts will have a monthly fee. The instance variable monthly fee will hold the monthly fee. Which of the following constructors properly sets the monthly fee to a default value of 207 public BankAccount (double initialBalance) { balance - initialBalance; monthlyFee - 20; 3 public BankAccount (double initialBalance) balance - initialBalance; double monthlyFee - 20 public BankAccount (double initialBalance) balance initialalance; monthlyFee initialBalance - 20; public BankAccount (double initialBalance) balance = initialBalance - 20
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
