public class Greetings{
	String msg;
	
	//is a Constructor with no arguments
	Greetings(){
		msg = "Hello....";
	}
	//is a Constructor
	Greetings(String x){
		msg = x;
	}
	// method returns void
	public void grv(){
		System.out.println("Greeting for today: " + msg);
	}
	//method returns String
	public String grs(){
		return "Greeting for today: " + msg;
	}
	//method - aka setter is usually void
	public void setMessage(String nx){
		msg = nx;
	}
	//testing through main
	public static void main(String arg[]){
		Greetings g = new Greetings();
		g.grv();
		g = new Greetings("Happy Holiday");
		g.grv();
		g.setMessage("Birthday");
		g.grv();
		g.setMessage("Thanksgiving");
		System.out.println(g.grs());
	}
}

    Source: geocities.com/dvshah