COMPILER DESIGN

ADVANCED TOPICS IN COMPILER DESIGN

CODE GENERATION FOR OBJECT ORIENTED LANGUAGES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
When overloading does not occur?
A
More than one method with same name but different method signature and different number or type of parameters
B
More than one method with same name, same signature but different number of signature
C
More than one method with same name, same signature, same number of parameters but different type
D
More than one method with same, same number of parameters and type but different signature
Explanation: 

Detailed explanation-1: -4. When Overloading does not occur? Explanation: Overloading occurs when more than one method with same name but different constructor and also when same signature but different number of parameters and/or parameter type.

Detailed explanation-2: -Overloading occurs when two or more methods in one class have the same method name but different parameters. Must have at least two methods by the same name in the class. Must have a different number of parameters. If the number of parameters is the same, then it must have different types of parameters.

Detailed explanation-3: -Overloading means same function name but different in signature. for e.g., we may have the same function name call area(), but code written in this function may differ. Overriding means the same function name with same signature.In this case we cannot change the code inside of that function.

There is 1 question to complete.