3 of 3
Paper No: 1
-content:String
-like:int
getContent():String - return content.
getLike():int - return like.
+Comment ()
setContent(content:String): void - update content.
+Comment (content:String, like:int)
+getContent():String
+getLike():int
setLike(like:int): void - update like.
+setContent(content:String):void
+setLike(like:int):void
The interface IComment below is already compiled and given in byte code format, thus you can use it without creating IComment.java file.
import java.util.List;
public interface IComment {
public int f1(List<Comment> t);
public void f2(List<Comment> t);
public void f3(List<Comment> t);
}
Write a class MyComment, which implements the interface IComment. The class MyComment implements methods f1, f2 and f3 in IComment as below (you can add other functions in MyComment
Zoom FUD
+ 100%
Close