Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Which of these classes is a utility class? A. Scanner B. Arrays C. Point D. BankAccount ==================================================== 2. What happens with the following code?

1. Which of these classes is a utility class?

A. Scanner

B. Arrays

C. Point

D. BankAccount

====================================================

2. What happens with the following code?

Question[] quiz = new Question[2];

quiz[0] = new ChoiceQuestion();

quiz[0].setText("What is the answer?");

quiz[0].addChoice("42", true);

quiz[0].addChoice("Something else", false);

quiz[0].display()

A. The code does not compile

B. The code compiles but does not display the choices when run

C. The code compiles and runs, but throws an exception when addChoice is called.

D. The program compiles and runs correctly.

=====================================================

3. What is displayed as the result of the following statements?

ChoiceQuestion cq = new ChoiceQuestion();

cq.setText("What is the answer?");

cq.addChoice("42", true);

Question q = cq;

q.display();

A. Nothing is displayed--there is a syntax error.

B. Nothing is displayed--the program crashes when executing one of these statements

C. Only the question text is displayed, not the choices.

D. The question text and choices are displayed.

(Seems these questions can't be answered here due to lack of information, however this is all the information that is given... Sorry)

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

Data Management Databases And Organizations

Authors: Richard T. Watson

3rd Edition

0471418455, 978-0471418450

More Books

Students also viewed these Databases questions