Label

Thứ Ba, 2 tháng 11, 2010

Is the following interface valid?

Question 4: Is the following interface valid?

public interface Marker {
}


Answer 4: Yes. Methods are not required. Empty interfaces can be used as types and to mark classes without requiring any particular method implementations. For an example of a useful empty interface, see java.io.Serializable.

Không có nhận xét nào:

Đăng nhận xét