void testByteO {
byte x = 0;
System.out.println("параметр типа byte:"); fl(x):f2(x);f3(x);f4(x);f5(x);f6(x);f7(x);
}
void testShortO {
short x = 0; printnb("short: ");
fl(x):f2(x):f3(x):f4(x);f5(x):f6(x);f7(x);print():
}
void testlntO {
int x = 0: printnbC'int: "):
fl(x) ;f2(x) ;f3(x) :f4(x) :f5(x) ;f6(x) ;f7(x); print ():
}
void testLongO {
long x = 0; printnbC'long:");
fl(x):f2(x):f3(x):f4(x):f5(x):f6(x):f7(x);print();
}
void testFloatO {
float x = 0:
System.out.pri nt1n("f1 oat:");
fl(x);f2(x);f3(x);f4(x);f5(x);f6(x);f7(x);print();
}
void testDoubleO {
double x = 0: printnb("double:"):
fl(x) ;f2(x) ;f3(x) ;f4(x) ;f5(x) ;f6(x) ;f7(x) ;print();
}
public static void main(String[] args) { PrimitiveOverloading p =
/new PrimitiveOverloadingO; p.testConstValО. p.testCharO; p.testByteО; p testShortO; p.testlntO; p.testLongO; p testFloatO; p.testDoubleO;
}
} /* Output:
5: fl(int) f2(int) f3(int) f4(int) f5(long) f6(float) f7(double) char: fl(char) f2(int) f3(int) f4(int) f5(long) f6(float) f7(double) byte: fl(byte) f2(byte) f3(short) f4(int) f5(long) f6(float) f7(double) short: fl(short) f2(short) f3(short) f4(int) f5(long) f6(float) f7(double) int: fl(int) f2(int) f3(int) f4(int) f5(long) f6(float) f7(double) long: fl(long) f2(long) f3(long) f4(long) f5(long) f6(float) f7(double) float: fl(float) f2(float) f3(float) f4(float) f5(float) f6(float) f7(double) double- fl(double) f2(double) f3(double) f4(double) f5(double) f6(double) f7(double) *///:-