Examine this package body: CREATE OR REPLACE PACKAGE BODY forward_pack IS V_sum NUMBER; - 44 - PROCEDURE calc_ord(. . . ); PROCEDURE generate_summary(. . . ) IS BEGIN Calc_ord(. . . ); . . . END calc_ord; END forward_pack; / Which construct has a forward declaration?
-
a) V_SUM
-
b) CALC_ORD.
-
c) FORWARD_PACK
-
d) GENERATE_SUMMARY.
B
Correct answer
Explanation
A forward declaration is when a subprogram is declared before its actual implementation - PROCEDURE calc_ord(. . . ); is declared at the top, then defined later in generate_summary. This allows calling subprograms before they're defined. Option B is correct. V_sum is a variable (A), forward_pack is the package name (C), and generate_summary is the procedure containing the forward call (D).