test.java

来自「Java 实践编程的源码」· Java 代码 · 共 18 行

JAVA
18
字号
public class Test
{
  public ImmutableCircle createWheel(double r)
  {
    return new MutableCircle(r);
  }

  public static void main(String args[])
  {
    Test t = new Test();
    ImmutableCircle iWheel = t.createWheel(5.0);
    System.out.println("Radius of wheel is " +
                       iWheel.radius());
    ((MutableCircle)iWheel).setRadius(7.4);
    System.out.println("Radius of wheel is now " +
                       iWheel.radius());
  }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?