day04-方法重载的练习

This commit is contained in:
2026-01-16 16:13:08 +08:00
parent 2bee27bfe2
commit bbe6fa6eec

View File

@@ -0,0 +1,39 @@
package com.inmind.overload02;
/*
下列哪些函数和给定函数重载了。
a.int show(int x,float y,char z)
b.void show(float b,int a,char c)
c.void show(int c,float a,char b)
d.void show(int a,int b,int c)
e.double show()
*/
public class Test05 {
void show(int a,float b,char c)
{
}
double show(){//参数列表的个数,数据类型,顺序不一致
return 1.1;
}
void show(int a,int b,int c){//参数列表的数据类型不一致
}
/*void show(int c,float a,char b){//不是,参数列表一致
}*/
/*int show(int x,float y,char z){ //不是,参数列表一致
return 1;
}*/
void show(float b,int a,char c){//参数列表的数据类型的顺序不一致
}
}