Just formatting App classes to be like the other class files on the project
This commit is contained in:
@ -1,35 +1,34 @@
|
||||
package com.iluwatar;
|
||||
|
||||
/**
|
||||
*
|
||||
* In Prototype we have a factory class (HeroFactoryImpl) producing
|
||||
* objects by cloning existing ones. In this example the factory's
|
||||
* prototype objects are given as constructor parameters.
|
||||
*
|
||||
* In Prototype we have a factory class (HeroFactoryImpl) producing objects by
|
||||
* cloning existing ones. In this example the factory's prototype objects are
|
||||
* given as constructor parameters.
|
||||
*
|
||||
*/
|
||||
public class App
|
||||
{
|
||||
public static void main( String[] args )
|
||||
{
|
||||
HeroFactory factory;
|
||||
Mage mage;
|
||||
Warlord warlord;
|
||||
Beast beast;
|
||||
|
||||
factory = new HeroFactoryImpl(new ElfMage(), new ElfWarlord(), new ElfBeast());
|
||||
mage = factory.createMage();
|
||||
warlord = factory.createWarlord();
|
||||
beast = factory.createBeast();
|
||||
System.out.println(mage);
|
||||
System.out.println(warlord);
|
||||
System.out.println(beast);
|
||||
|
||||
factory = new HeroFactoryImpl(new OrcMage(), new OrcWarlord(), new OrcBeast());
|
||||
mage = factory.createMage();
|
||||
warlord = factory.createWarlord();
|
||||
beast = factory.createBeast();
|
||||
System.out.println(mage);
|
||||
System.out.println(warlord);
|
||||
System.out.println(beast);
|
||||
public class App {
|
||||
|
||||
public static void main(String[] args) {
|
||||
HeroFactory factory;
|
||||
Mage mage;
|
||||
Warlord warlord;
|
||||
Beast beast;
|
||||
|
||||
factory = new HeroFactoryImpl(new ElfMage(), new ElfWarlord(), new ElfBeast());
|
||||
mage = factory.createMage();
|
||||
warlord = factory.createWarlord();
|
||||
beast = factory.createBeast();
|
||||
System.out.println(mage);
|
||||
System.out.println(warlord);
|
||||
System.out.println(beast);
|
||||
|
||||
factory = new HeroFactoryImpl(new OrcMage(), new OrcWarlord(), new OrcBeast());
|
||||
mage = factory.createMage();
|
||||
warlord = factory.createWarlord();
|
||||
beast = factory.createBeast();
|
||||
System.out.println(mage);
|
||||
System.out.println(warlord);
|
||||
System.out.println(beast);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user