Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Homework help - URGENT!
#1
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?
Reply
#2
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.
[Image: burninglove4.png]
Reply
#3
The answer is method 3 Big Grin thanks for your help.

/close
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)