Courseiva
Developer Fundamentals →easyMultiple Choice

SALESFORCE-PD1 Practice Question: Which Apex data type should a developer use to represent a precise geographic location…

Which Apex data type should a developer use to represent a precise geographic location with latitude and longitude coordinates?

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

✓

Location

The Location primitive data type in Apex is designed specifically to represent geographic locations with latitude and longitude.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Coordinate

    Why it's wrong here

    Coordinate is not a valid Apex primitive or built-in data type, meaning developers cannot declare variables or build SOQL queries using this non-existent structure to hold geographical coordinates. It often appears tempting because its literal English meaning directly describes latitude and longitude pairs, leading developers to assume a corresponding programmatic type exists for mapping features. However, Salesforce actually uses the `Location` data type for geolocation fields and spatial queries, rendering this imaginary type completely unusable in real code.

  • ✓

    Location

    Why this is correct

    The built-in Apex `Location` data type directly satisfies the requirement for representing a precise geographic location with latitude and longitude coordinates. Unlike generic numeric or string variables, `Location` natively stores spatial data using compound fields, allowing developers to perform built-in distance calculations such as `EucDist` or `toMiles`. It ensures type safety and seamless integration with Salesforce geolocation fields and SOQL spatial functions like `DISTANCE()` and `GEOLOCATION()`, fulfilling the exact criteria specified in the stem.

  • ✗

    Address

    Why it's wrong here

    Address is a compound field holding street, city, postal code and country, with no latitude or longitude components. It tempts developers seeking a structured location field, but precise coordinates require the Location compound field, whose Latitude and Longitude subfields store geographic position; Address cannot represent them.

  • ✗

    GeoPoint

    Why it's wrong here

    `GeoPoint` is incorrect because it is not a valid Apex primitive or built-in data type for handling geographic coordinates within developer logic, meaning it cannot be instantiated or assigned values as a variable type in code. It sounds tempting because the term closely mirrors location-based terminology, and developers frequently encounter similarly named objects or UI components when configuring maps or geolocation fields in Salesforce metadata. However, native Apex utilises the `Location` class to represent latitude and longitude coordinates.

About these practice questions

One of 345 original SALESFORCE-PD1 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

You might also like

Similar SALESFORCE-PD1 questions

Written and reviewed by Johnson Ajibi, MSc IT Security

Security Systems Architect · founder of Courseiva

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

This SALESFORCE-PD1 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 SALESFORCE-PD1 exam.