Provide the definition of an abstract class named DesktopComponent that contains the following:
- a void (abstract) method, onClicked, 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

Respuesta :

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 onClick();

   

   

 

}

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

What is an abstract in a writing?

An abstract is a concise summary of a research paper or entire thesis. It is an original work, not an excerpted passage. An abstract must be fully self-contained and make sense by itself, without further reference to outside sources or to the actual paper.

What is abstract and example?

An abstract is an outline/brief summary of your paper and your whole project. It should have an intro, body and conclusion. It is a well-developed paragraph, should be exact in wording, and must be understandable to a wide audience.

To learn more about an abstract, refer

https://brainly.com/question/1062434

#SPJ2

ACCESS MORE
EDU ACCESS