Ask Question
12 February, 09:32

Provide the definition of an abstract class named DesktopComponent that contains the following:

- a void (abstract) method, o nclicked, that accepts no parameters and is to be supplied by a subclass.

- a (private) string named type, describing the sort of Desktop component (e. g. window, icon, taskbar, etc).

- a constructor accepting a string that is used to initialize the type instance variable

+4
Answers (1)
  1. 12 February, 10:35
    0
    package mypackage; / / Whatever package this should be in.

    public abstract class DesktopComponent {

    private String type;

    / / Alternatively you may want a final variable.

    / / private final String type;

    public DesktopComponent (String type)

    {

    this. type = type;

    }

    abstract void o nclick ();

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Provide the definition of an abstract class named DesktopComponent that contains the following: - a void (abstract) method, o ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers