@@ -0,0 +1,1005 @@
+/*%0A5. %5BTests knowledge of concept of static%5D %0A%0ACreate a Java class that allows at most 5 instances of itself to be created. %0ACall your class JustFive. Provide a main method in your class that attempts to create 6 instances of your class.%0A*/%0A%0Aimport java.util.List;%0Aimport java.util.ArrayList;%0Aimport java.util.Arrays;%0A%0A%0Aclass QuestionFive0%0A%7B%0A%09public static void main(String%5B%5D args) %7B%0A%09%09System.out.println(%22Question Five%22);%0A%09%09// JustFive j1 = new JustFive();  // Error: private access%0A%09%09List%3CJustFive%3E instanceArr = new ArrayList%3CJustFive%3E();%0A%09%09for (int i = 1; i %3C= 6; i++) %7B%0A%09%09%09JustFive temp = JustFive.CreateInstance();%0A%09%09%09instanceArr.add(temp);%0A%09%09%09System.out.println(String.format(%22Count of instance: %25d%22, instanceArr.size()));%0A%09%09%7D%0A%09%7D%0A%7D%0A%0Aclass JustFive%0A%7B%0A%09private JustFive() %7B%7D%0A%09private static int i = 0;%0A%09%0A%09public static JustFive CreateInstance() %7B%0A%09%09if (i %3C 5) %7B%0A%09%09%09i++;%0A%09%09%09return new JustFive();%0A%09%09%7D else %7B%0A%09%09%09throw new SecurityException(%22Can't create more that 5 instance of this class!%22);%0A%09%09%7D%0A%09%7D%0A%0A%7D

Add JustFive class.