fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class OLoadTest {
  9. public static void main(String[] args) {
  10. OLoad a = new OLoad();
  11. a.compute(1,2);
  12. a.compute(2,2.0f);
  13. a.compute((float)4,2.0f);
  14. }
  15. }
  16.  
  17. class OLoad{
  18. void compute(int a, int b){
  19. System.out.println(a+b);
  20. }
  21. void compute(float a, float b){
  22. System.out.println(a * b);
  23. }
  24. void compute(int a, float b){
  25. System.out.println(a / b);
  26. }
  27. }
Success #stdin #stdout 0.06s 38328KB
stdin
Standard input is empty
stdout
3
1.0
8.0