jweinst1
10/1/2015 - 7:50 PM

basic java class that represents a word

basic java class that represents a word

public class Word {
	public String word;
	public Word(String data) {
		this.word = data;
	}
	public void addword(String addition) {
		this.word += addition;
	}

	public static void main(String[] args) {
		Word fun = new Word("holy");
		fun.addword("this rocks");
		System.out.println(fun.word);

	}

}