if you want to remove an article from website contact us from top.

    which of the following class definitions defines a legal abstract class?

    Mohammed

    Guys, does anyone know the answer?

    get which of the following class definitions defines a legal abstract class? from screen.

    To use the interactive quiz, login from http://wps.pearsoned.com/ecs_liang_ijp_10 and choose Quiz.

    स्रोत : liveexample-ppe.pearsoncmg.com

    CS II Chapter 13 Quiz Flashcards

    Study with Quizlet and memorize flashcards containing terms like 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 { abstract void unfinished(); } D. public class abstract A { abstract void unfinished(); }, Which of the following declares an abstract method in an abstract Java class? A. public abstract method(); B. public abstract void method(); C. public void abstract method(); D. public void method() {} E. public abstract void method() {}, 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 and more.

    CS II Chapter 13 Quiz

    4.3 (6 reviews) Term 1 / 35

    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 { abstract void unfinished(); }

    D. public class abstract A { abstract void unfinished(); }

    Click the card to flip 👆

    Definition 1 / 35 C

    Click the card to flip 👆

    Created by haleighstudy

    Terms in this set (35)

    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 { abstract void unfinished(); }

    D. public class abstract A { abstract void unfinished(); }

    C

    Which of the following declares an abstract method in an abstract Java class?

    A. public abstract method();

    B. public abstract void method();

    C. public void abstract method();

    D. public void method() {}

    E. public abstract void method() {}

    B

    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

    A

    Which of the following statements regarding abstract methods is false?

    A. Abstract classes have constructors.

    B. A class that contains abstract methods must be abstract.

    C. It is possible to declare an abstract class that contains no abstract methods.

    D. An abstract method cannot be contained in a nonabstract class.

    E. A data field can be declared abstract

    E

    Suppose A is an abstract class, B is a concrete subclass of A, and both A and B have a no-arg constructor. Which of the following is correct?

    A. A a = new A(); B. A a = new B(); C. B b = new A(); D. B b = new B(); B and D

    What is the output of running class Test?

    public class Test {

    public static void main(String[] args) {

    new Circle9(); } }

    public abstract class GeometricObject {

    protected GeometricObject() {

    System.out.print("A");

    }

    protected GeometricObject(String color, boolean filled) {

    System.out.print("B");

    } }

    public class Circle9 extends GeometricObject {

    /* No-arg constructor /

    public Circle9() { this(1.0);

    System.out.print("C");

    }

    /* Construct circle with a specified radius /

    public Circle9(double radius) {

    this(radius, "white", false);

    System.out.print("D");

    }

    /* Construct a circle with specified radius, filled, and color /

    public Circle9(double radius, String color, boolean filled) {

    super(color, filled);

    System.out.print("E");

    } } A. ABCD B. BACD C. CBAE D. AEDC E. BEDC E

    The java.lang.Number and its subclasses are introduced in Chapter 11. Analyze the following code.

    Number numberRef = new Integer(0);

    Double doubleRef = (Double)numberRef;

    Which of the following statements is correct?

    A. There is no such class named Integer. You should use the class Int.

    B. The compiler detects that numberRef is not an instance of Double.

    C. A runtime class casting exception occurs, since numberRef is not an instance of Double.

    D. The program runs fine, since Integer is a subclass of Double.

    E. You can convert an int to double, so you can cast an Integer instance to a Double instance

    C

    Analyze the following code.

    Number[] numberArray = new Integer[2];

    numberArray[0] = new Double(1.5);

    Which of the following statements is correct?

    A. You cannot use Number as a data type since it is an abstract class.

    B. Since each element of numberArray is of the Number type, you cannot assign an Integer object to it.

    C. Since each element of numberArray is of the Number type, you cannot assign a Double object to it.

    D. At runtime, new Integer[2] is assigned to numberArray. This makes each element of numberArray an Integer object. So you cannot assign a Double object to it

    D

    Analyze the following code. Which of the following statements is correct?

    public class Test {

    public static void main(String[] args) {

    Number x = new Integer(3);

    System.out.println(x.intValue());

    System.out.println(x.compareTo(new Integer(4)));

    } }

    A. The program has a compile error because an Integer instance cannot be assigned to a Number 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 compareTo method.

    D. The program compiles and runs fine

    C

    Analyze the following code. Which of the following statements is correct?

    public class Test {

    public static void main(String[] args) {

    Number x = new Integer(3);

    System.out.println(x.intValue());

    System.out.println((Integer)x.compareTo(new Integer(4)));

    }

    स्रोत : quizlet.com

    Which of the following class definitions defines a legal abstract class

    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 { abstract void unfinished(); } d) public class abstract A { abstract void unfinished(); }

    Examveda

    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 { abstract void unfinished(); }

    D. public class abstract A { abstract void unfinished(); }

    Answer: Option C

    Click here to read 1000+ Related Questions on Interfaces and Abstract Classes(Java Program)

    Join The Discussion

    Join The Discussion Comments ( 1 )

    SHANMUKH CHANDRA : 2 years ago

    why can't i make the abstract class with public specifier

    Related Questions on Interfaces and Abstract Classes

    Given the following piece of code:

    public class School{

    public abstract double numberOfStudent();

    }

    which of the following statements is true?

    A. The keywords public and abstract cannot be used together.

    B. The method numberOfStudent() in class School must have a body.

    C. You must add a return statement in method numberOfStudent().

    D. Class School must be defined abstract.

    View Answer

    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 { abstract void unfinished(); }

    D. public class abstract A { abstract void unfinished(); }

    View Answer

    Which of the following declares an abstract method in an abstract Java class?

    A. public abstract method();

    B. public abstract void method();

    C. public void abstract Method();

    D. public void method() {}

    E. public abstract void method() {}

    View Answer

    Which of the following statements regarding abstract classes are true?

    A. An abstract class can be extended.

    B. A subclass of a non-abstract superclass can be abstract.

    C. A subclass can override a concrete method in a superclass to declare it abstract.

    D. An abstract class can be used as a data type.

    E. All of the above View Answer

    More Related Questions on Interfaces and Abstract Classes

    Read More: MCQ Type Questions and Answers

    Arithmetic Ability

    Competitive Reasoning

    Competitive English Data Interpretation General Knowledge History Geography Current Affairs Banking Awareness

    Computer Fundamentals

    Networking C Program Java Program SQL Database HTML CSS Javascript PHP Computer Science

    Electrical Engineering

    Mechanical Engineering

    Civil Engineering

    Chemical Engineering

    Commerce Management

    स्रोत : www.examveda.com

    Do you want to see answer or more ?
    Mohammed 7 day ago
    4

    Guys, does anyone know the answer?

    Click For Answer