Back To Java User Defined Methods Index
//program to create a function that prints the table of the number passed to it as argument class table { public void ptable(int a) { int i; for(i=1;i<=10;i++) { System.out.println(a*i); } } } public class printtable { public static void main(String[] args) { table ob=new table(); ob.ptable(5); } }