ellesehc

thesaurus

Aug 16th, 2015
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.61 KB | None | 0 0
  1. public class thesaurus {
  2.  
  3.     public static void main(String[] args) {
  4.  
  5.         String word = "big";
  6.  
  7.         String[][] thesaurus = {{"big", "huge", "massive", "gargantuan"},
  8.         {"happy", "joyful", "gleeful"}, {"sad", "dejected", "sorrowful", "wretched", "crestfallen"}};
  9.  
  10.         for (int row = 0; row < thesaurus.length; row++){
  11.             for (int column = 0; column < thesaurus[row].length; column++){
  12.                 if (!thesaurus[row][column].equals(word)){
  13.                     System.out.println(thesaurus[row][column]);
  14.                 }
  15.  
  16.                 }
  17.  
  18.             }
  19.     }
  20. }
  21. //Prints out:
  22. //[Ljava.lang.String;@366412da
  23. //[Ljava.lang.String;@6411c21b
  24. //[Ljava.lang.String;@49deadf0
Advertisement
Add Comment
Please, Sign In to add comment