I need help to Write a Circle class that implements the Comparable interface. (We compare Circles by their radii.)
[B][COLOR="DarkGreen"]public class Circle
{
private Point center;
private int radius;
// Direct constructor
public Circle(Point p, int d)
{
center = p;
radius = d;
}
}[/COLOR][/B]
This one too please:
Lots of Java statements can cause exceptions to be thrown. For example, any method called on an object (e.g., bee.foo()) will throw a NullPointerException if bee is null. Rewrite the method below to catch the exception.
[COLOR="DarkGreen"][B]public void whatever()throws NullPointerException
{
bee.foo();
}[/B][/COLOR]
Edited by Roger, 09 December 2010 - 09:57 AM.
added code tags


Sign In
Create Account


Back to top









