Structures inheritance in Java
Forums:
//In Java there are no structures
interface IText {
String toText();
}
class Point implements IText {
public int x, y;
public String toText() {
return String.format("x = %d; y = %d", x, y);
}
}
class RedPoint extends Point { }
- Log in to post comments