Which two statements about the overloading feature of packages are true? (Choose two)

  1. a) Only local or packaged sub programs can be overloaded.

  2. b) Overloading allows different functions with the same name that differ only in their return types.

  3. c) Overloading allows different subprograms with the same number, type and order of the parameter.

  4. d) Overloading allows different subprograms with the same name and same number or type of the parameters.

  5. e) Overloading allows different subprograms with the same name but different in either number or type or order of parameter.


Correct Option: A,E

AI Explanation

To answer this question, we need to understand the concept of overloading in packages.

Option A) Only local or packaged subprograms can be overloaded. This statement is true. Overloading can only be applied to subprograms within a package or to local subprograms.

Option B) Overloading allows different functions with the same name that differ only in their return types. This statement is false. Overloading does not consider the return type of the function. It only considers the number, type, and order of the parameters.

Option C) Overloading allows different subprograms with the same number, type, and order of the parameters. This statement is false. Overloading allows different subprograms with the same name but different in either the number or type or order of the parameters.

Option D) Overloading allows different subprograms with the same name and same number or type of the parameters. This statement is false. Overloading allows different subprograms with the same name but with different numbers or types or orders of parameters.

Option E) Overloading allows different subprograms with the same name but different in either number or type or order of the parameter. This statement is true. Overloading allows different subprograms within a package or local subprograms with the same name but different numbers or types or orders of parameters.

Therefore, the correct statements about the overloading feature of packages are Option A) and Option E).

Find more quizzes: