CORRECT DETAILED ANSWERS (VERIFIED
ANSWERS); ALREADY GRADED A+
________ is a library of classes that do not replace
________, but provide an improved alternative for
creating GUI applications. - correct answer-
Swing, AWT
A class, which implements an interface, does not override
a method in the interface and does not causes errors
when it is compiled because the method is a __________
method. - correct answer- default
A method header consists of which of the following parts?
- correct answer- An access specifier, a return
type, a method name, and a list of the parameters (if any)
A subclass class can directly access - correct
answer- Only public and protected members of the
superclass class
,A user-defined exception - correct answer- is a
checked exception
All fields declared in an interface - correct answer-
Are final and static
An _______________ is an object that is generated in
memory as the result of an error or an unexpected event
- correct answer- Exception
An instance method of a class is called by specifying which
3 items in the specified order? - correct answer-
Object, method name, parameters
Array bounds checking happens _________________ -
correct answer- When the program runs
Assume the class, Course, contains an object of the class,
Instructor, as a private data member. To instantiate the
Instructor object in the Course, use the following code:
,instructor = new Instructor(instr); - correct answer-
It makes a copy of the object the instr references
Consider the following code fragment:
String
letterGrade = "";
if (grade < 90)
if (grade >= 80)
letterGrade = "B";
else
letterGrade = "A";
System.out.println(letterGrade);
What is the value of letterGrade when the grade is 70? -
correct answer- A
Consider the following code fragment:
, Circle c1 = new Circle(3);
Circle c2 = new Circle(3);
Circle c3 = c2;
boolean condition = c3.equals(c1);
What is the value of condition assuming that two circles
are considered equal if they have the same radius value?
- correct answer- True
Consider the following statement:
String greeting = "Hello, World!"; //note: there is a space
after the comma
int len = greeting.replace("World", "Dave").length();
What is the value of the variable len? - correct
answer- 12