@@ -0,0 +1,775 @@
+/*%0A%09Class Numbers - holds an array of numbers%0A*/%0A%0Apackage design_patterns.strategy_design_pattern;%0Aimport design_patterns.strategy_design_pattern.PrintType;%0Aimport design_patterns.strategy_design_pattern.PrintNormal; %09%09// Strategy 1%0Aimport design_patterns.strategy_design_pattern.PrintReverse; %09 %09// Strategy 2%0A%0Aclass Numbers%7B%0A%0A%09int%5B%5D num;%09%09%09%09// Array of numbers%0A%09PrintType printType;%09// Reference of type PrintType%0A%0A%0A%09// initializes the array with input array%0A%09// sets print type to PrintNormal%0A%0A%09public Numbers(int%5B%5D A)%7B%0A%0A%09%09num = A;%0A%09%09printType = new PrintNormal(); %09%0A%0A%09%7D%0A%0A%0A%09// Prints Array based on selected strategy%0A%0A%09public void print()%7B%0A%09%09printType.printArray(num);%0A%09%7D%0A%0A%0A%09// Sets print type as specified%0A%0A%09public void setPrintType(PrintType p)%7B%0A%09%09printType = p;%0A%09%7D%0A%0A%7D%09%0A

Add class numbers to use the print strategies