码迷,mamicode.com
首页 > 编程语言 > 详细

java_函数重载练习

时间:2017-10-20 18:30:52      阅读:247      评论:0      收藏:0      [点我收藏+]

标签:失败   bsp   hello   函数重载   编译   oid   sys   答案   world   

 1 class  
 2 {
 3     public static void main(String[] args) 
 4     {
 5         System.out.println("Hello World!");
 6     }
 7 }
 8 
 9 
10 public static void show(int x,char y,double z)
11 下列哪个答案和给定的函数重载了
12 
13 a.
14 public static int show(char y,int x ,double z)
15 {return 1;}
16 
17 /重载了,参数类型不同,而且和返回值类型无关
18 
19 
20 b.
21 public static boid show (int a,char b,double c){}
22 //没有,和给定的函数一抹一样。出现在同一类会编译失败,应为有了调用的不确定性。
23 
24 c.
25 public static void show(double z,int x ,char y){}
26 //重载了,参数类型不同
27 
28 
29 d.
30 public static double show(int a, char y){}
31 //重载了,参数个数不同
32 
33 e.
34 public static void show(int x,char y,double z){}
35 //重载,函数名不同

 

java_函数重载练习

标签:失败   bsp   hello   函数重载   编译   oid   sys   答案   world   

原文地址:http://www.cnblogs.com/Wll-Fss/p/7700348.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!