This will not run, and I am pulling it straight from the how-to....

public class add
{ 
	public static void main(String[] args) 
	{ 
		int sum = add(5, 2);
		System.out.println("Sum is " + sum);
		
		public static int add(int firstInt, int secondInt)
		{
		return firstInt + secondInt;
		}
	}
}

I would love to see the source you are pulling this from. You cannot create a method inside another method.

public class add
{ 
	public static void main(String[] args) 
	{ 
		int sum = add(5, 2);
		System.out.println("Sum is " + sum);
		
		public static int add(int firstInt, int secondInt)
		{
		return firstInt + secondInt;
		} //Wrong!
	}
}
public class add
{ 
	public static void main(String[] args) 
	{ 
		int sum = add(5, 2);
		System.out.println("Sum is " + sum);
		
		
	}
 public static int add(int firstInt, int secondInt)
		{
		return firstInt + secondInt;
		}//Right!
}