Support Forums

Full Version: Homework help - URGENT!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey guys! I'm doing a timed worksheet for my Java class. I need help with this question:
Quote:Consider the following incomplete classes:

public abstract class MyClass
{
public void method1(int fred)
{
// implementation not shown
}

public abstract void method2(int barney);
}

public interface MyInterface
{
public void method3(int wilma);
}

Which of the following methods must be defined in a class that implements MyInterface?

I. method1
II. method2
III. method3

I only

II only

I and II only

III only

II and III only

I think the answer is method II only, because it's abstract.
What's the right answer?
I'm not sure, I keep changing my mind but I think either method 1 or 3 would have to be included.
I don't think method 2 by itself if at all with be right.
The answer is method 3 Big Grin thanks for your help.

/close