Method_Call_Example_Min_Of_Two_No

class Method_Call_Example_Min_Of_Two_No
{
public static int Min(int a , int b)
{
int Min;
if (a>b)
Min=b;
else
Min=a;
return Min;
}
public static void main (String args[])
{
int a = 5;
int b =6;
int c= Min(a,b);
System.out.println(c);
}
}
/**
**@ int - is used because it return a value i.e Min (a no )
**@ void - is used when it does not return any value but only statement
*/

No comments:

Post a Comment