Question: JAVA 1.Which of the below options describe a design in which class B is a derived class of base class A? A Class A is

JAVA

1.Which of the below options describe a design in which class B is a derived class of base class A?

A

Class A is an Sleeve, something that goes into a shirt, jacket or sweater.

Class B is a Jacket.

B

Class A is a Jacket something that is worn to keep a person warm.

Class B is an JacketSleeve (something that goes into a Jacket).

C

Class A is an MensApparelItem, which is stocked and sold by a department store like Macy's.

Class B is an InventoryItem, something a business stocks and sells to a customer. It has an item number and price.

D

Class A is an InventoryItem, something a business stocks and sells to a customer. It has an item number and price.

Class B is an MensApparelItem, which is stocked and sold by a department store like Macy's.

2.

Check the true statement(s) (There is at least one correct choice, possibly more.)

A A static method can access a static member (of the same class) inside its definition using only the member name, no object or class name prepended (i.e., without ClassName. or someObj. in front).
B A static method can access an instance member (of the same class) inside its definition using only the member name, no object or class name prepended (i.e., without someObj. in front).
C An instance method can access a static member (of the same class) inside its definition using only the member name, no object or class name prepended (i.e., without ClassName. or someObj. in front).
D

An instance method can access an instance member (of the same class) inside its definition using only the member name, no object or class name prepended (i.e., without ClassName. or someObj. in front).

3.

Which of the following statements are true?

A "First In, First Out" or FIFO structure..
B A stack is a collection that restricts access at one end of the stack..
C A stack is a random access container that allows access to any element, regardless of its position in the stack.
D The stack is a "Last In, First Out" or LIFO structure..
E You can only add new elements to either end of a stack, and you can only remove items from either end.
F

You can only add new elements to one end of a stack, and you can only remove items from that same end.

4.

We would test whether a parseInt() failed due to a NumberFormatException by:

A. using an if statement block that appeared after the parseInt() statement.
B. placing the parseInt() call in the try portion of a try/catch block.
C. using a try/catch block that appeared after the parseInt() statement.
D.

placing the parseInt() call in the catch portion of a try/catch block.

5.

A constructor is used to:

A ... initialize the instance members of a class.
B ... declare the member variables of a class.
C ... initialize the static members of a class.
D ... initialize both instance and static members of a class.

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!