liuhuzone

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2012年5月2日

摘要: 方法的重载定义:方法的重载是指一个类中可以定义有相同的名字,但参数不同的多个方法。根据不同的参数表选择对应的方法。[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.... 阅读全文
posted @ 2012-05-02 16:55 刘浒 阅读(273) 评论(0) 推荐(0) 编辑