Open1C
Sun Feb 12 2023 00:44:08 GMT+0000 (Coordinated Universal Time)
Saved by
@Achilles_17
class C3{
int methodC1(int c1){
return c1 + c1;
}
int methodC2(int c1, int c2){
return c1 + c2;
}
}
public class Open1C{
C3 agentA = new C3();
int ex1 = this.agentA.methodC1(7);
int ex2 = this.agentA.methodC2(7, 7);
}
// Statement C is true, it is possible to have two different methods within the same class
// use the same parameter name and type, because it is not acting within the same scope.
//Program Output:
// ex1 = 14
// ex2 = 14
content_copyCOPY
Comments