54.9k views
4 votes
Write an interface, PointingDevice, containing: an abstract method, getXCoord that returns an int an abstract method, getYCoord that returns an int an abstract method, attentionRequired that returns a boolean an abstract method, setResolution that accepts a double and returns a double

User Jjz
by
6.5k points

1 Answer

4 votes

Answer:

Following are the code in java language

abstract interface PointingDevice // interface PointingDevice,

{

// abstract method getXCoord()

public abstract int getXCoord();

// abstract method getYCoord()

public abstract int getYCoord();

// abstract method attentionRequired()

public abstract boolean attentionRequired();

// abstract method setResolution( )

public abstract double setResolution(double a);

}

Step-by-step explanation:

In this code we have declared a abstract interface "PointingDevice" which contains the four abstract method getXCoord of type int , getYCoord() of type int , attentionRequired() of type boolean and setResolution() of type double .

These method have only declaration not definition any interface or class which inherit the inteface PointingDevice must define all these four method otherwise it also be abstract .

User Hungry Beast
by
7.1k points