摘要:
方法的重载定义:方法的重载是指一个类中可以定义有相同的名字,但参数不同的多个方法。根据不同的参数表选择对应的方法。[code lang="java"] public class Test { void max(int a , int b) { System.out.println( a > b ? a : b ); } void max(short a , short b) { System.... 阅读全文
摘要:
方法的重载定义:方法的重载是指一个类中可以定义有相同的名字,但参数不同的多个方法。根据不同的参数表选择对应的方法。[code lang="java"] public class Test { void max(int a , int b) { System.out.println( a > b ? a : b ); } void max(short a , short b) { System.... 阅读全文
|