kalkulator
public class Racun { public long zbroj(long x, long y){ System.out.println("Metoda long-zbroj"); return x+y; } public double zbroj(double x, double y){ System.out.println("Metoda double-zbroj"); return x+y; }
public static void main(String[] args) { Racun racun = new Racun(); Racun r1=new Racun(); Racun r2=new Racun();
System.out.println(r1.zbroj(1234,4321)); System.out.println(r2.zbroj(12.34,43.21)); System.out.println();