My compile time errors are this: "not a statement", and "';' missing", both in reference to line 9 a countless number of times.
Here's my class:
package Hangman;
public class Words
{
public String word(int x)
{
int wordNumber = x;
String words[] = {"aardvark", "abuse", "accept", "acid", "actor", "adobe", "advise", "agate", "air", "almond", "altar", "amongst", "angle", "apathy", "apple", "arch", "arsenic", "attack", "azure", "ballast", "baron", "bayonet", "beaver", "bellow", "beret", "bisect", "blight", "blister", "blunder", "bologna", "borrow", "brawn", "brisk", "buffalo", "bully", "butter", "canal", "candle", "canteen", "capital", "caribou", "cassette", "cayenne", "chaplain", "chastise", "chime", "chimney", "chivalry", "choler", "chronology", "civic", "clock", "clutch", "cohesion", "column", "combat", "commune", "compose", "conserve", "conscience", "cosmos", "crafty", "crayon", "crown", "cuff", "cyclops", "dandy", "daunt", "debt", "define", "depot", "dewy", "dilate", "discern", "dispatch", "docile", "dock", "dominion", "down", "dress", "drift", "drum", "duly", "dye", "earth", "economic", "eggnog", "ellipse", "elven", "embitter", "emu", "enrich", "escape", "ether", "eve", "evil", "ewe", "expense", "eye", "facet", "fawn", "fax", "fez", "finale", "fire", "fix", "flout", "forge", "frolic", "front", "futile", "fuzz", "gala", "gamble", "gangrene", "gargoyle", "gaze", "geode", "gizzard", "glow", "gnome", "gnu", "govern", "grasp", "grew", "gruel", "gypsy", "gym", "hanker", "hasty", "helm", "hexagon", "hygiene", "hysteria", "ibis", "immense", "imperial", "improvise", "independence", "infer", "inflict", "ink", "instep", "interfere", "intersect", "invariable", "iodize", "iritation", "isthmus", "jib", "jig", "judge", "junk", "kale", "kernel", "kimono", "knight", "koala", "kumquat", "lanyard", "larceny", "lapse", "latent", "latter", "lavish", "lazy", "lenient", "lieutenant", "lime", "line", "llama", "lozenge", "lyric", "macaque", "macron", "majestic", "magnet", "manganese", "mantle", "manipulate", "margin", "mayor", "maximum", "meddle", "midget", "military", "mingle", "misread", "mistook", "mobilize", "mountain", "murky", "myriad", "natural", "nebula", "neither", "niche", "night", "north", "noteworthy", "nutriment", "obnoxious", "obvious", "ocular", "offense", "oddity", "often", "omelette", "oodles", "oppose", "ornate", "oxbow", "ozone", "paddle", "page", "pajamas", "palace", "papyrus", "parachute", "parkway", "partake", "patron", "patter", "pavilion", "peculiar", "penicillin", "perchance", "periscope", "persimmon", "persist", "pheasant", "phlegm", "piccolo", "pigeon", "pioneer", "plaque", "pliable", "poison", "poodle", "porpoise", "powder", "precedent", "premium", "previous", "privacy", "product", "proper", "prophet", "pronounce", "public", "punctual", "pupil", "pushy", "puzzle" "pyramid", "python", "quack", "quail", "quarter", "query", "quick", "quiver", "quiz", "rabid", "radiate", "rake", "rancid", "rascle" "rattle", "reality", "receive", "recycle", "refer", "refuel" "reign", "relent", "remorse", "repent", "resist", "respect", "retrieve", "rhythm", "rifle", "roar", "rooster", "rough", "ruffian", "runway", "ruthless", "safety", "sailors", "sanguine", "sampler", "sapwood", "savage", "scalp", "schedule", "score", "scorn", "sculpture", "scuttle", "sear", "secret", "seek", "sensitive", "serial", "sever", "shave", "shore", "shortage", "shorten", "sick", "sign", "silicon", "siphon", "skill", "skunk", "slave", "sleight", "sling", "slouch", "smite", "snipe", "social", "solitude", "sonorous", "sought", "soy", "spasm", "spectrum", "spider", "spoil", "squall", "squint", "stale", "stalwart", "standard", "steeple", "stencil", "stilt", "sting", "strain", "stretcher", "stump", "sturgeon", "sunbeam", "superhero", "surplus", "sword", "system", "tackle", "tactless", "tailor", "talon", "tangible", "tawny", "tear", "temper", "tender", "tension", "terrier", "theater", "thieve", "thourough", "thrive", "thunder", "tinder", "topple", "totem", "toxic", "traffic", "transit", "trap", "trick", "triple", "trounce", "tuber", "tunic", "twelve", "typing", "umpire", "under", "unequal", "unify", "unlucky", "unrest", "untie", "uproot", "vaccine", "valid", "vary", "vend", "ventricle", "venture", "victim", "viola", "vocal", "vole", "vow", "wagon", "wander", "warp", "watch", "water", "wax", "weld", "wheedle", "whine", "whisk", "whole", "wiggle", "window", "wisp", "witless", "wonder", "wreck", "wrung", "yacht", "yoke", "yonder", "yule", "zealous", "zebra", "zeppelin", "zoom"};
wordNumber = 600;
String word = words[wordNumber];
System.out.println(word);
return word;
}
}
This class serves as the dictionary to a hangman game I'm making (idea from Martyr2's idea list), with the input as the random number generated by the method that calls on it (so that its more random - with this many words, I need better randomness). I'm completely lost here, as I rarely use arrays. Could anyone provide insight on this?
edit: nevermind. posting it here highlighted my problem: a missing quotation mark.
edit: still getting the errors.