fubarable

TestImports

Nov 12th, 2016
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.67 KB | None | 0 0
  1. public class CheckImports {
  2.     public static void main(String[] args) {
  3.         String[] theClass = {
  4.                 "import java.x;",
  5.                 "import java.y;",
  6.                 "import java.z;",
  7.                 "import java.x;", };
  8.        
  9.         checkImports(theClass);
  10.     }
  11.  
  12.     private static void checkImports(String[] theClass) {
  13.         // import tester
  14.         for (int i = 0; i < theClass.length; i++) {
  15.             for (int j = 0; j < i; j++) {
  16.                 if (theClass[i].equals(theClass[j])) {
  17.                     System.out.printf("Strings are equal for i,j: [%d, %d]%n", i, j);
  18.                 }
  19.             }
  20.         }
  21.     }
  22. }
Add Comment
Please, Sign In to add comment