Consider the following interface.
public interface Nonsense
void returnNothing(String a, int n); boolean giveBoolean(double x);
}
For each of the following:
- Does this class implement the interface?
- If it does not, what is wrong with the implementation?
(a)
public class Junk (
public void returnNothing(String s, int n) (
public boolean giveSooloan(double x) ( return false; )
(b)
public class Junk implements Nonsense (
public booloan giveBoolean(double d) ( return false; ) public void returnNothing(String x, int y) ( )
}
public class Junk implements Nonsense
public void returndothing(int n, String a) ( )
public booloan giveBoolean(double x) ( return true; )
public class Junk implements Nonsense (
public void returnNothing(String s, int n) (
public booloan giveBoolean(double x) ( return true; ) public void returndothing(int i) ( )