Methods in java
public class MethodExample
{
public static void main(String args[])
{
printHi();
int add = Addition(8, 3);
System.out.println(add);
}
public static void printHi()
{
// This method has no return value
System.out.println("Hi!");
}
public static int Addition(int a, int b)
{
// This method has a return value
return a + b;
}
}