// Methods.java

public class Methods
{
	public static void main(String[] args)
	{
		// call another method (function) in this class
		sayHello();

		// pass a parameter to another method
		write(6);

		// pass a parameter and get a return value
		int i = 3, num;
		num = triple(i);
		System.out.print("main: num now is: ");
		write(num);
	}

	static void sayHello()
	{
		System.out.println("Welcome to the Methods program!");
	}

	static void write(int i)
	{
		System.out.println(i);
	}

	static int triple(int i)
	{
		System.out.print("triple: input value of i = ");
		write(i);
		return i * 3;
	}
}