⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 client.java

📁 这个文件里面包含了java设计模式的一些例子讲解
💻 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 + -