📄 client.java
字号:
package com.javapatterns.prototype.bike;
public class Client
{
CloneableBike first;
CloneableBike second;
public static void main(String[] args)
{
// Create two CloneableBike class object references
CloneableBike first, second;
// Create the first bike object from scratch
first = new CloneableBike(4,26);
first.setAge(3);
// Create the second bike object by cloning the first
second = (CloneableBike) first.clone();
// Now describe these bikes on the system console :
System.out.println(" First bike age : "+first.getAge());
System.out.println(" gears : "+first.getGears());
System.out.println(" wheel size : "+first.getWheelSize());
System.out.println("Second bike age : "+second.getAge());
System.out.println(" gears : "+second.getGears());
System.out.println(" wheel size : "+second.getWheelSize());
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -