Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Which of the following class definitions defines a legal abstract class? a. class A (abstract void unfinished) b. class A (abstract void unfinished;) c.

image text in transcribed
1. Which of the following class definitions defines a legal abstract class? a. class A (abstract void unfinished) b. class A (abstract void unfinished;) c. abstract class A fabstract void unfinished0: d. public class abstract A (abstract void unfinished0: 2. Which of the following declares an abstract method in an abstract Java class? a. public abstract method0: b. public abstract void method): c. public void abstract method0 d. public void method 0 e. public abstract void method() i 3. Which of the following statements regarding abstract methods is false? a. An abstract class can have instances created using the constructor of the abstract class. b. An abstract class can be extended. C. A subclass of a non-abstract superclass can be abstract. d. A subclass can override a concrete method in a superclass to declare it abstract. e. An abstract class can be used as a data type. 4. Analyze the following code. Which of the following statements is correct? public class Test f public static void main(Stringl) args) ( Number x-new Integer(3); System.out.printin(x.intValue()); System.out.printin(x.compareTo(new Integer(4)): e program has a compile error because an Integer instance cannot be assigned to a Numbe variable b. The program has a compile error because intValue is an abstract method in Number. c. The program has a compile error because x does not have the compare To method. d. The program compiles and runs fine

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

DATABASE Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions

Question

Explain where you can find business rules in an organization.

Answered: 1 week ago