forked from mastifikator/FantasyJavaPatterns
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
13 lines (11 loc) · 494 Bytes
/
Main.java
File metadata and controls
13 lines (11 loc) · 494 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
package Prototype;
public class Main {
public static void main(String[] args) throws Exception{
Unit unitOriginal = new Unit("Кентавр", "рыбак", "Петя");
Unit unitClone = (Unit)unitOriginal.clone();
unitClone.setName("КлонПети");
System.out.println(unitOriginal.toString());
System.out.println("Кентавра клонировали и изменили имя!");
System.out.println(unitClone.toString());
}
}