Question 146

Given the code fragment:

Which two modifications should you make so that the code compiles successfully?
  • Question 147

    Given:

    Which code fragment can replace the if block?
  • Question 148

    Given the code fragment:

    Which modification enables the code to print 54321?
  • Question 149

    View the exhibit:
    public class Student {
    public String name = "";
    public int age = 0;
    public String major = "Undeclared";
    public boolean fulltime = true;
    public void display() {
    System.out.println("Name: " + name + " Major: " + major); }
    public boolean isFullTime() {
    return fulltime; } }
    Which line of code initializes a student instance?
  • Question 150

    Given the code fragment:

    What is the result?