Ask Question
24 September, 10:29

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. 24 September, 10:52
    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?
Get 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 & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers