overload.java
来自「it is a good tool to help you study java」· Java 代码 · 共 22 行
JAVA
22 行
class OverloadDemo{
void test(){
System.out.println("No parameters");
}
void test(int a,int b)
{
System.out.println("a and b : "+a+" "+b);
}
void test(double a){
System.out.println("Inside test(double) a:"+a);
}
}
class Overload{
public static void main(String args[]){
OverloadDemo ob=new OverloadDemo();
int i=80;
ob.test();
ob.test(10,20);
ob.test(i);
ob.test(123.25);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?