Ask Question
1 December, 18:45

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

+5
Answers (1)
  1. 1 December, 19:10
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers