@Test
public void testPrzeciazanieMetod(){
f(5); //int
f(3/2); //int
short s=12;
f(s); //short
f(s-1); //int
f(1-1.0f); //float
f(s-1.0f); //float
byte b=10;
f(b/2); //int
f(b*b); //int
}
public void f(float x){ prn("float");}
public void f(byte x){ prn("byte"); }
public void f(short x){prn("short");}
public void f(int x){prn("int");}
Brak komentarzy:
Prześlij komentarz