logo

Crowdly

Looking for test answers and solutions? Browse our comprehensive collection of verified answers for at moodle.lsu.edu.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

Consider the following class hierarchy:

public class Vehicle

{

   private String type;

   public Vehicle(String type)

   {

      this.type = type;

   }

   public String displayInfo()

   {

      return type;

   }

}

public class LandVehicle extends Vehicle

{

   public LandVehicle(String type)

   {

      super(type);

   }

}

public class Auto extends LandVehicle

{

   public Auto(String type)

   {

      super(type);

   }

}

You have written a program to use these classes, as shown in the following code snippet:

public class VehicleTester

{

   public static void main(String[] args)

   {

      Auto myAuto = new Auto("sedan");

      System.out.println("MyAuto type = " + ______);

   }

}

Complete the code in this program snippet to correctly display the auto's type. 

100%
0%
0%
0%
View this question

Consider the following code snippet:

public class Vessel

{

   private String manufacturer;

   . . .

   public void setVesselClass(double engineRPM)

   {

      . . .

   }

}

If a Speedboat class is created as a subclass of the Vessel class, which of the following statements is correct? 

0%
0%
0%
100%
View this question

Consider the following code snippet:

public class Vehicle

{

   private String manufacturer;

   . . .

   public void setVehicleClass(double numberAxles)

   {

       . . .

   }

}

If a Motorcycle class is created as a subclass of the Vehicle class, which of the following statements is correct? 

0%
0%
0%
100%
View this question

Which of the following indicates that the Motorcycle class is a subclass of the Vehicle class?

100%
0%
0%
0%
View this question

What must a subclass do to modify a private superclass instance variable? 

0%
0%
100%
0%
View this question

Which of the following indicates that a class named ClassA class is a superclass of the ClassB class? 

100%
0%
0%
0%
View this question

 Which of the following indicates that a class named Class1 is a subclass of a class named Class2?

100%
0%
0%
0%
View this question

Which of the following is true regarding subclasses?

0%
0%
0%
0%
View this question

You are creating a Motorcycle class that is supposed to be a subclass of the Vehicle class. Which of the following class declaration statements will accomplish this? 

0%
100%
0%
0%
View this question

You are creating a Motorcycle class which is supposed to be a subclass of the Vehicle class. Which of the following class declaration statements will accomplish this? 

100%
0%
0%
0%
View this question

Want instant access to all verified answers on moodle.lsu.edu?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!