Back To Java User Defined Methods Index
//program to create a function that takes three integer arguments and finds largest of them class largethree { public void flarge(int a,int b,int c) { int max; max=a; if(b>max) { max=b; } if(c>max) { max=c; } System.out.println("largest of three numbers is " + max); } } public class largestthree { public static void main(String[] args) { largethree ob=new largethree(); ob.flarge(30,20,40); } }