Back To Java User Defined Methods Index
//program to create a function that takes three integer arguments and calculates their sum class calcsum { public void csum(int a,int b,int c) { int sum; sum=a+b+c; System.out.println("sum of three numbers is " + sum); } } public class sumthreeintegers { public static void main(String[] args) { calcsum ob=new calcsum(); ob.csum(10,20,30); } }