Current location - Training Enrollment Network - Mathematics courses - Java defines a class MyMath that implements common mathematical operations.
Java defines a class MyMath that implements common mathematical operations.
These are very simple procedures, practice well by yourself, and the following code is for reference only.

Public class MyMath{

Public MyMath(){

}

public static int max(int a,int b,int c){

int max = a;

if(max & lt; b){

max = b;

}

if(max & lt; c){

max = c;

}

Return to max

}

public static int min(int a,int b,int c){

int min = a;

if(min & gt; b){

min = b;

} else if(min & gt; c){

min = c;

}

Returns the minimum value;

}

public static int sum(int a,int b,int c){

Return a+b+c;

}

public static double average (int a,int b,int c){

return sum(a,b,c)/3;

}

}