Just formatting App classes to be like the other class files on the project
This commit is contained in:
@ -1,29 +1,29 @@
|
||||
package com.iluwatar;
|
||||
|
||||
/**
|
||||
*
|
||||
* The essence of the Abstract Factory pattern is a factory interface (KingdomFactory)
|
||||
* and its implementations (ElfKingdomFactory, OrcKingdomFactory).
|
||||
*
|
||||
* The example uses both concrete implementations to create a king, a castle and an
|
||||
* army.
|
||||
*
|
||||
* The essence of the Abstract Factory pattern is a factory interface
|
||||
* (KingdomFactory) and its implementations (ElfKingdomFactory,
|
||||
* OrcKingdomFactory).
|
||||
*
|
||||
* The example uses both concrete implementations to create a king, a castle and
|
||||
* an army.
|
||||
*
|
||||
*/
|
||||
public class App
|
||||
{
|
||||
public static void main( String[] args )
|
||||
{
|
||||
createKingdom(new ElfKingdomFactory());
|
||||
createKingdom(new OrcKingdomFactory());
|
||||
public class App {
|
||||
|
||||
public static void main(String[] args) {
|
||||
createKingdom(new ElfKingdomFactory());
|
||||
createKingdom(new OrcKingdomFactory());
|
||||
}
|
||||
|
||||
|
||||
public static void createKingdom(KingdomFactory factory) {
|
||||
King king = factory.createKing();
|
||||
Castle castle = factory.createCastle();
|
||||
Army army = factory.createArmy();
|
||||
System.out.println("The kingdom was created.");
|
||||
System.out.println(king);
|
||||
System.out.println(castle);
|
||||
System.out.println(army);
|
||||
King king = factory.createKing();
|
||||
Castle castle = factory.createCastle();
|
||||
Army army = factory.createArmy();
|
||||
System.out.println("The kingdom was created.");
|
||||
System.out.println(king);
|
||||
System.out.println(castle);
|
||||
System.out.println(army);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user