@@ -0,0 +1,1097 @@
+/*%0A2. %5BTests Java language and prob solving%5D %0AWrite a Java method testForSum which determines whether a given array of integers %0Acontains three entries whose sum is equal to a given integer. Assume the following:%0A%0Aa. The method accepts an array intArr of int%E2%80%99s and an int testInt as its two arguments%0Ab. The return type of the method is boolean%0Ac. The method returns true if and only if there are distinct integers i, j, k such that %0A    intArr%5Bi%5D + intArr%5Bj%5D + intArr%5Bk%5D equals testInt.%0A%0ATest your method in a main method, which passes the following input values%0A%7B5, 1, 23, 21, 17, 2, 3, 9, 12%7D, 22 into the method testForSum, %0Aand which outputs the return value to the console.%0A*/%0A%0A%0Aclass QuestionTwo0%0A%7B%0A%09public static void main(String%5B%5D args) %7B%0A%09%09System.out.println(%22Question One%22);%0A%09%09int%5B%5D intArr = new int%5B%5D %7B5, 1, 23, 21, 17, 2, 3, 9, 12%7D;%0A%09%09boolean ret = testForSum(intArr, 22);%0A%09%09System.out.println(ret);%0A%09%7D%0A%0A%09static boolean testForSum(int%5B%5D intArr, int testInt) %7B%0A%09%09int sum = 0;%0A%09%09for (int item: intArr) %7B%0A%09%09%09sum += item;%0A%09%09%7D%0A%09%09System.out.println(sum);%0A%09%09return (sum == testInt);%0A    %7D%0A%0A%7D

Add testForSum method.