Private versus Public Items:
Let consider the subsequent example:
CREATE OR REPLACE PACKAGE TESTVAR AS X NUMBER:=0;
END;
Look again at the package sord. The package body declares a variable named X that is initialized to zero. Unlike items declared in the specification of SORD the items declared in the body are restricted to use within the package. Thus, PL/SQL code outside the package cannot reference the function chkqty. Like as items are termed private.
Therefore, items declared in the specification of testvar such as the variable x are visible outside the package. Thus, any PL/SQL code can reference the variable x. like as items are termed public.
When items are to be maintained they must be during a session or across transactions and placed in the declarative part of the package body. In the package specification if the items are to be made public.
Note: When a packaged subprogram remotely then the overall package is reinstantiated and its previous state is lost.