package exer4;
public class test1 extends B implements A{
public void getX() {
System.out.println(super.x);
System.out.println(A.x);
}
public static void main(String[] args) {
new test1().getX();
}
}
interface A{
int x=0;
}
class B{
int x=1;
}
package exer4;
public class test2{
public static void main(String[] args) {
Ball b=new Ball();
b.play();
}
}
interface Playable{
void play();
}
interface Bunceable{
void play();
}
interface Rollable extends Playable,Bunceable{
Ball ball=new Ball("pingpang");
}
class Ball implements Rollable{
private String name;
public String getName() {
return name;
}
public Ball() {}
public Ball(String name) {
this.name=name;
}
@Override
public void play() {
System.out.println(ball.getName());
}
}