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 code snippet:
public class Motorcycle extends Vehicle
{
. . .
public Motorcycle(int numberAxles)
{
super.numberAxles;
}
}
What does this code do?
Consider the following code snippet:
public class Motorcycle extends Vehicle
{
. . .
public Motorcycle(int numberAxles)
{
super(numberAxles); //line #1
}
}
If the line marked "//line #1" was missing, which of these statements would be correct?
Consider the following code snippet:
public class Motorcycle extends Vehicle
{
. . .
public Motorcycle(int numberAxles)
{
super(numberAxles);
}
}
What does this code do?
Consider the following code snippet:
public class Auto extends Vehicle
{
. . .
public Auto(int numberAxles)
{
super(numberAxles);
}
}
What does this code do?
Consider the following code snippet that appears in a subclass:
public void deposit(double amount)
{
transactionCount ++;
deposit(amount);
}
Which of the following statements is true?
If a subclass uses the same method name but different parameter types for a method that appears in its superclass, ____.
If a subclass contains a method with the same name as a method in its superclass, but with different parameter types, the subclass method is said to ____ the method of the superclass.
Consider the following code snippet:
public class Employee
{
. . .
public void setEmployeeDept(String deptNum)
{
. . .
}
}
public class Programmer extends Employee
{
. . .
public void setEmployeeDept(int deptNum)
{
. . .
}
}
Which of the following statements is correct?
Consider the following code snippet:
public class Vehicle
{
. . .
public void setVehicleClass(double numberAxles)
{
. . .
}
}
public class Auto extends Vehicle
{
. . .
public void setVehicleClass(int numberAxles)
{
. . .
}
}
Which of the following statements is correct?
Consider the following code snippet:
public class Employee
{
. . .
public void setDepartment(String deptName)
{
. . .
}
}
public class Programmer extends Employee
{
. . .
public void setProjectName(String projName)
{
. . .
}
public void setDepartment(String deptName)
{
. . .
}
}
Which of the following statements is NOT correct?
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!