Software Meth Midterm
(asked in both tests) A subclass inherits all methods, data members and constructors from the superclass
False
(asked in both tests) If the modifier in a method signature is omitted., the modifier public is assumed
False
(asked in both tests) Java assigns a default value to a local variable in a method if the variable is not initialized.
False
(asked in both tests) String s = new String("java"); the statement Object o = s; creates new instance of Object
False
(asked in both tests) The following statement will not cause compile error, assuming all classes are properly defined: public class myBike extends Mountainbike, RoadBike implements Bicycle{ ... }
False
(asked in both tests) The purpose of Testbed main() in a class is to run software (or system) testing
False
A java interface class may contain constructors
False
A static method can directly access the instance variables within a class without instantiating an object
False
A subclass can extend multiple super classes but can implement only one java interface
False
An instance variable can be directly referenced in a static method within the same class without creating an object
False
Assume Employee class is an abstract class. The following statement outside Employee class will not cause a compile error: Employee e = new Employee
False
Object obj = new Object; Student student = new Student(); the statement student = obj; will not cause a compile error
False
Object x = new Object(); Employee y = new Employee(); the statement y = x will not cause a compile error
False
RuntimeException and Error are known as checked exceptions
False
Software inspection is a software testing technique that requires software developers to run the programs with test cases
False
Software inspection is a software testing technique that requires the software developers to run the programs with the test cases
False
Student s1 = new Student("Alice"); Student s2 = new Student("Bob"); s1 = s2; Assume student class has an overriding toString() method, System.out.println(s1.toString()) will output Alice;
False
The code below will compile: class Square extends GeometricObject { double length; Square(double length) { GeometricObject(length); }
False
Assume Employee class is an abstract class. The following statement outside of Employee class will not cause a compile error: Employee [] emps = new Employee[Capacity]
True
The statement Object [] list = new String[100]; will compile
True
You declare int height; within a public method and declare int height; as an instance variable within the same class. This will not cause a compile error
True
you can declare a local variable that has the same name as an instance variable in the class
True
