What is an abstract class? Give an example and explain how it works.

What will be an ideal response?


Sometimes, a parent class is so general that you never intend to create any specific instances of the class. For example, you might never create an object that is "just" an Employee; each Employee is more specifically a SalariedEmployee, an HourlyEmployee, or a ContractEmployee. A class such as Employee that you create only to extend from, but not to instantiate objects from, is an abstract class. An abstract class is one from which you cannot create any concrete objects, but from which you can inherit. Abstract classes usually have one or more empty abstract methods. You use the keyword abstract when you declare an abstract class.

Computer Science & Information Technology

You might also like to view...

In the Color Picker, Photoshop offers 255 hues to work with.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

In general, animation may appear jerky and slow if each frame is displayed for more than about:

a. 1/30th of a second b. 1/15th of a second c. 1/4th of a second d. 1/2 of a second e. 1 second

Computer Science & Information Technology

When a user authenticates to your network, a web access control infrastructure performs authentication and passes attributes in a HTTP header to multiple applications. What is this process called?

A. federated authentication B. delegated authentication C. single sign-on D. portal authentication

Computer Science & Information Technology

A user's smartphone cannot connect via Wi-Fi, cellular, or Bluetooth. Which of the following should be disabled to correct this problem?

a. Power management b. Airplane mode c. USB tethering d. Bluetooth pairing

Computer Science & Information Technology