java - Need a word list from the internet -


Hello I'm making a hangin game and I want an array of words coming from the internet. It is not for me to start, can anyone help? This is the code.
  get public string (try {url = url = new URL ("http://dictionary-thesaurus.com/wordlists/Adjectives%28929%29.txt"); // URLConnection urlConnection = (URLConnection) url.openConnection (); // inStream = new inputstream reader (urlConnection.getInputStream ()); BufferedReader = new in BufferedReader (new InputStreamReader (url.openstream ())); String str = faucet; ArrayList & LT; String & gt; Line = new arreelist & lt; String & gt; (); While ((str = in.readline ())! = Null {lines (str); word = lines.error (new string [lines.size]);}} hold (exception e) {e.getStackTrace ( );} Random R = New Random (); int num; Num = r.nextInt (words.length); Return word [num];}    

Try it.

  public static zero main (string [] args) {ArrayList  line = new Arrielist & lt; string & gt; (); Try {url = url = new URL ("http://dictionary-thesaurus.com/wordlists/Adjectives(929).txt"); BufferedReader = New in BufferedReader (New InputStreamReader ( Url.openstream ()); Tring str = faucet; while ((str = in.readline ()) = null {lines (str);}} hold (exception e) {e.printStackTrace ();} System.out.println (line); }    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -