Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle9i Database Administration

Authors: Sam R. Alapati

1st Edition

1590590228, 978-1590590225

More Books

Students also viewed these Databases questions

Question

7. Where Do We Begin?

Answered: 1 week ago

Question

a. What is the purpose of the team?

Answered: 1 week ago