Courseiva

SF-PD2 Testing, Debugging, and Deployment Practice Question

A developer maintains a managed package and must release a new version. During packaging, the developer needs to ensure that a specific Apex class is accessible to subscriber orgs but that its implementation details remain hidden. Which packaging construct should the developer use?

⚠ Common exam trap

Watch out — candidates often confuse profile-based Apex class access, which controls execution rights inside an org, with the global modifier that defines a managed package's cross-namespace API.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Mark the Apex class as global and expose only global method signatures, keeping internal helper methods private.

Managed package Apex visibility is governed by the global access modifier. Declaring the class and selected methods global exposes a stable API to subscriber code across namespaces, while private helpers and internal logic stay hidden. This supports controlled upgrades because global signatures are versioned with the package.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    Mark the Apex class as global and expose only global method signatures, keeping internal helper methods private.

    Why this is correct

    In a managed package, only global Apex members are visible and callable from outside the package namespace. Declaring the class global with a curated set of global method signatures exposes the intended API, while private and public helpers remain internal. This is the supported way to ship a public interface without revealing implementation, and it enables versioning through the package upgrade process.

  • ✗

    Deploy the Apex class using the Metadata API with the unpackaged flag enabled to keep it outside the managed namespace.

    Why it's wrong here

    There is no unpackaged flag on a Metadata API deploy that exempts a component from a managed package; components included in a package version belong to that namespace. Deploying the class separately would place it in the subscriber's own namespace, defeating the goal of shipping it as part of the managed offering. This misstates how package membership is determined.

  • ✗

    Set the Apex class access to Public in the package's profile settings so subscribers can call it directly.

    Why it's wrong here

    Apex class access settings on profiles and permission sets control which users inside an org can execute a class; they do not define the package's external API surface. A public class in a managed package is still not callable from subscriber code outside the namespace. The visibility boundary for packaged Apex is determined by the global modifier, not by profile access.

  • ✗

    Add the Apex class to a protected custom setting so it is packaged but not exposed to subscriber code.

    Why it's wrong here

    Protected custom settings hide data from subscriber orgs but have no relationship to Apex class visibility. Custom settings store configuration records, not code access rules, and the class would still be governed by the global modifier. This choice conflates a data-hiding feature with the Apex access model in managed packages.

About these practice questions

This SF-PD2 question is part of Courseiva's 226-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Salesforce exam blueprint

This SF-PD2 practice question is part of Courseiva's free Salesforce certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SF-PD2 exam.