public class MyMath{
public static int add(int a, int b){
return a+b;
}
public static double add(double a, double b){
return a+b;
}
public static long add(long a,long b){
return a+b;
}
public static float add(float a,float b){
return a+b;
}
}
///
public class MyMathTest{
public static void main(String[] args){
System.out.println(MyMath.add(1,2));
System.out.println(MyMath.add(1234L,1432L));
System.out.println(MyMath.add(1.27,24.8));
System.out.println(MyMath.add(1.23F,1.45F));
}
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter