Question: 2. What is similar between an abstract class an interface? A. Both can have concrete methods. B. Both can have abstract methods C. Both imply

2. What is similar between an abstract class an interface?

A. Both can have concrete methods.

B. Both can have abstract methods

C. Both imply an inheritance relationship.

D. Neither can be instantiated.

E. Neither can be extended.

6. What is output by the following code?

ArrayList a = new ArrayList();

ArrayList b = a;

a.dd(new Integer(4));

b.add(new Integer(5));

b.add(new Integer(7));

System.out.println(a.get(3)):

A. An IndexOutOfBoundsException occurs.

B. 4

C. 5

D. 6

E. 7

7. To extend an abstract class, a class must:

A. implement all abstract methods in the abstract class.

B. implement at least one abstract method from the abstract class.

C include new methods.

D. specify the keyword implements

E. specify the keyword extends.

9. which keyword is required if you want to define a class constant?

A. Private

B. public

C. int

D. final

E. abstract

10. What does overloading mean?

A. Defining a subclass method with an identical name, return type, and parameter list that is invoked instead of the parent class method.

B. Defining a subclass method with an identical name and parameter list subclass that is invoked instead of the parent class method.

C. Defining two or more methods in a class with the same name, return type and parameter list, to perform functions that are slightly different from one another.

D. Defining two or more methods in a class with the same name but different return types and parameter lists, to perform function that are slightly different from one another.

E. Defining two or more methods in a class with the same name but different parameter lists, to perform functions that are slightly different from one another.

11. What is the maximum number of locations that a binary search algorithm will have to examine when looking for a particular value in a sorted array of 50 elements?

A. 1

B. 6

C. 7

D. 8

E. 100

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!