Back To Java User Defined Methods Index
//program to create a function that inputs two numbers and finds their product class prod { public void product(int a,int b) { int pro; pro=a*b; System.out.println("product of two numbers is " + pro); } } public class producttwointegers { public static void main(String[] args) { prod ob=new prod(); ob.product(5, 10); } }