What is an abstract class?

1 Answer

Answer :

A: An abstract class is a class that is declared abstract—it may or may not include abstract methods. Abstract classes cannot be instantiated, but they can be subclassed.

Related questions

Description : Data input is A) an abstract class defined in java.io B) a class we can use to read primitive data types C) an interface that defines methods to open files. D) an interface that defines methods to read primitive data types.

Last Answer : D) an interface that defines methods to read primitive data types.

Description : Data input is A) an abstract class defined in java.io B) a class we can use to read primitive data types C) an interface that defines methods to open files. D) an interface that defines methods to read primitive data types.

Last Answer : D) an interface that defines methods to read primitive data types.

Description : State true or false for Java Program. i) Data members of an interface are by default final ii) An abstract class has implementations of all methods defined inside it. A) i-false, ii-false B) i-false, ii-true C) i-true, ii-false D) i-true, ii-true

Last Answer : C) i-true, ii-false

Description : A ………………. Is a class whose instances themselves are classes. A) Subclass B) Abstract Class C) Meta Class D) Object Class

Last Answer : C) Meta Class

Description : Which of the following is/are correct with reference to Abstract class and interface ? (a) A class can inherit only one Abstract class but may inherit several interfaces. (b) An Abstract class can provide complete and default ... true (C) Both (a) and (b) are true (D) Neither (a) nor (b) is true

Last Answer : Answer: C

Description : Which of the following is used to make an Abstract class ? (A) Making atleast one member function as pure virtual function (B) Making atleast one member function as virtual function (C) Declaring as Abstract class using virtual keyword (D) Declaring as Abstract class using static keyword

Last Answer : (A) Making atleast one member function as pure virtual function

Description : Which of the following statements is correct? (A) Every class containing abstract method must not be declared abstract. (B) Abstract class cannot be directly initiated with ‘new’ operator. (C) Abstract class cannot be initiated. (D) Abstract class contains definition of implementation.

Last Answer : Answer: B,C

Description : Which of the following statement(s) with regard to an abstract class in JAVA is/are TRUE? I. An abstract class is one that is not used to create objects. II. An abstract class is designed only to act as a base class ... by other classes. (1) Only l (2) Only II (3) Neither I nor II (4) Both l and II

Last Answer : Both l and II

Description : What is an abstract method?

Last Answer : A: An abstract method is a method that is declared without an implementation (without braces, and followed by a semicolon), like this: abstract void point(double x, double y);

Description : In java, string is a ............. A) primitive data type B) abstract data type C) combination of boolean D) None of the above

Last Answer : B) abstract data type

Description : The .................. and .................... classes are abstract classes that support reading and writing of byte streams. A) reader, writer B) inputstream, outputstream C) objectinputstream, objectoutputstream D) none

Last Answer : B) inputstream, outputstream

Description : The .................. and .................... classes are abstract classes that support reading and writing of byte streams. A) reader, writer B) inputstream, outputstream C) objectinputstream, objectoutputstream D) none

Last Answer : B) inputstream, outputstream

Description : Which of the following is true about the characteristics of abstract data types? i) It exports a type. ii) It exports a set of operations A) True, False B) False, True C) True, True D) False, False

Last Answer : C) True, True

Description : ……………….. level is where the model becomes compatible executable code A) Abstract level B) Application level C) Implementation level D) All of the above

Last Answer : C) Implementation level

Description : Which if the following is/are the levels of implementation of data structure A) Abstract level B) Application level C) Implementation level D) All of the above

Last Answer : D) All of the above

Description : Describe an abstract class and explain when one might be useful.

Last Answer : An abstract class is a class that cannot be instantiated but must be inherited. It can contain both implemented methods and abstract methods, which must be implemented in an inheriting class. ... common interface for other methods, and leave more detailed implementation up to the inheriting class.

Description : What’s the difference between an interface and abstract class?

Last Answer : Answer: An abstract class and Interface both have method only but not have body of method.The difference between Abstract class and An Interface is that if u call Ablstract class then u have to call ... type, Parameter type, Parameter Number all must be same . Only body of method can change. 

Description : When do you absolutely have to declare a class as abstract?

Last Answer : 1. When the class itself is inherited from an abstract class, but not all base abstract methods have been overridden. 2. When at least one of the methods in the class is abstract.

Description : What’s an abstract class?

Last Answer : Answer:Classes that cannot be instantiated. We cannot create an object from such a class for use in our program. We can use an abstract class as a base class, creating new classes that will inherit from ... can inherit from a non-abstract class. In C++, this concept is known as pure virtual method.

Description : Write some code using interfaces, virtual methods, and an abstract class.

Last Answer : using System; public interface Iexample1 { int MyMethod1(); } public interface Iexample2 { int MyMethod2(); } public abstract class ABSExample : Iexample1, Iexample2 { public ABSExample( ... override void VIRTMethod2() { System.Console.WriteLine("VIRTMethod2 has been overridden"); } }

Description : When do you absolutely have to declare a class as abstract?

Last Answer : 1. When the class itself is inherited from an abstract class, but not all base abstract methods have been overridden. 2. When at least one of the methods in the class is abstract.

Description : What’s an abstract class?

Last Answer : A class that cannot be instantiated. An abstract class is a class that must be inherited and have the methods overridden. An abstract class is essentially a blueprint for a class without any implementation.

Description : When do you absolutely have to declare a class as abstract (as opposed to free-willed educated choice or decision based on UML diagram)?

Last Answer : When at least one of the methods in the class is abstract. When the class itself is inherited from an abstract class, but not all base abstract methods have been overridden.

Description : What’s an abstract class? 

Last Answer : A class that cannot be instantiated. A concept in C++ known as pure virtual method. A class that must be inherited and have the methods over-ridden. Essentially, it’s a blueprint for a class without any implementation.

Description : A class is a variable of variable that is declared inside a class as: a) Final b) Static c) Abstract d) Extends e) None of The Above

Last Answer : b) Static

Description : Define what are the features of abstract class?

Last Answer : 1. An abstract class cannot be instantiated, and it is an error to use the new operator on an abstract class. 2. An abstract class is permitted (but not required) to contain abstract methods and accessors. 3. An abstract class cannot be scaled.

Description : Difference between Abstract and Concrete Class ?

Last Answer : Ans. Abstract classes are only meant to be sub classed and not meant to be instantiated whereas concrete classes are meant to be instantiated.

Description : Which of the following statements is true (A) Abstract data types are the same as classes (B) Abstract data types do not allow inheritance (C) Classes cannot inherit from the same base class (D) Object have state and behavior

Last Answer : (B) Abstract data types do not allow inheritance

Description : What is abstract class? Give one example of abstract class.

Last Answer : An abstract class is a class that is designed only to act as base class. It is not used to create objects. An abstract class is used to define an implementation and is intended to be inherited by child classes. Example: ... >a; } void display() { coutb; } void display1()  { display(); cout

Description : Define abstract class.

Last Answer : An abstract class is a class that is designed only to act as base class. It is not used to create objects.

Description : Name some function of Scanner class.

Last Answer : A: next(), nextInt(), hasNextInt() etc.

Description : Name some function of StringTokenizer class.

Last Answer : A: nextToken(), countToken(), hasMoreTokens() etc.

Description : What are wrapper class?

Last Answer : A wrapper class is a class which wraps (encloses) around a data type and gives it an object appearance. Wherever, the data type is required as an object, this object can be used.

Description : What is a class variable?

Last Answer : A: Instance variables having the keyword ‘static’ before it is a class variable. For every object there is just one copy of the variable made.

Description : Can a package be called as a class?

Last Answer : A: Yes, Package is actually a class present in java.lang package.

Description : What is a class?

Last Answer : A: A class is a blueprint or prototype from which objects are created.

Description : State true of false. i) Public can only be assigned to class ii) Protected protects a statement iii) Protected method is never accessible outside the package iv) Friendly variable may be accessible outside class A) i- ... -false, ii-true, iii-false, iv-false D) i-true, ii-false, iii-false, iv-true

Last Answer : C) i-false, ii-true, iii-false, iv-false

Description : Each method in a java class must have a unique name . A) Not necessary B) True C) False D) None of the above

Last Answer : A) Not necessary

Description : State true or false. i) Jpanel is a class included in awt package. ii) Anonymous classes are mostly used for event handling. iii) Names of anonymous classes must be unique iv) JOptionPane is an inner class A) i-false ... ) i-false, ii-true, iii-false, iv-false D) i-true, ii-false, iii-false, iv-true

Last Answer : C) i-false, ii-true, iii-false, iv-false

Description : Using which keyword we can access value of the instance variables and class variables of that class inside the method of that class itself. A) super B) final C) this D) either super or this

Last Answer : C) this

Description : The concept of multiple inheritance is implemented in Java by A) extending two or more classes B) extending one class and implementing one or more interfaces C) implementing two or more interfaces D) both B and C

Last Answer : D) both B and C

Description : Which of the following methods belong to the string class? A) length( ) B) compare To ( ) C) equals ( ) D) All of them

Last Answer : D) All of them

Description : The concept of multiple inheritance is implemented in Java by A) extending two or more classes B) extending one class and implementing one or more interfaces C) implementing two or more interfaces D) both B and C

Last Answer : D) both B and C

Description : Which of the following methods belong to the string class? A) length( ) B) compare To ( ) C) equals ( ) D) All of them

Last Answer : D) All of them

Description : The class string belongs to ................... package. A) java.awt B) java.lang C) java.applet D) java.string

Last Answer : B) java.lang

Description : The class at the top of exception class hierarchy is .......................... A) ArithmeticException B) Throwable C) Class D) Exception

Last Answer : B) Throwable

Description : ...................... of a remotely accessible object must implement ................ A) all methods, RemoteException B) class, RemoteException C) class, RemoteInterface D) all methods, RemoteInterface

Last Answer : C) class, RemoteInterface

Description : State true or false for Java Program. i) All class variables are instance variables ii) All protected methods are friendly methods A) i-false, ii-false B) i-false, ii-true

Last Answer : B) i-false, ii-true

Description : The out object is an object encapsulated inside the ................. class, and represents the standard output device. A) standard B) local C) globlal D) system

Last Answer : D) system