Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8977185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:18:54+00:00 2026-06-15T19:18:54+00:00

I am trying to understand some code we went over today in class where

  • 0

I am trying to understand some code we went over today in class where we created a class below,

    class Datapoint
    {
        private string latitude;
        private string longtitude;
        private string elevation;

        public Datapoint()
        {
            latitude = "no data";
            longtitude = "no data";
            elevation = "no data";
        }

        public Datapoint(string latitude, string longtitude, string elevation)
        {
            this.latitude = latitude;
            this.longtitude = longtitude;
            this.elevation = elevation;
        }

        public string Latitude { get { return latitude; } }
        public string Longtitude { get { return longtitude; } }
        public string Elevation { get { return elevation; } }
    }

and then made a list from this class,

List<Datapoint> datapoints; 

Is this a list that goes

latitude 
longtitude
elevation
latitude 
longtitude
elevation
latitude 
longtitude
elevation
latitude 
longtitude
elevation

and so on and so forth? Thank you for any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T19:18:55+00:00Added an answer on June 15, 2026 at 7:18 pm

    It seems you are thinking of the Datapoint class as itself a type of list structure. While you could think of it this way, that isn’t the way most programmers would visualize it.

    An easier entity to understand might be a person. Do you think of a person as a list, like this?

    • Age
    • Gender
    • Height
    • Weight
    • Hair color
    • Eye color

    …and so on? I think not. A person has many attributes or properties; but if you consider a list of people, this list is not simply a concatenated sequence of person-properties but rather of person entities (or instances).

    So as others have pointed out, a List<Datapoint>, or a list of Datapoint objects, is not merely a list of the properties of these objects but in fact a list of the objects themselves (each of which has properties).


    At a lower level, if you’re asking how this information is stored then you’re actually close. Obviously, for a Datapoint object to be allocated in memory, there must be room for all of its properties; and these will most likely be allocated in a contiguous block (though at this point we’re getting to a level of implementation detail most developers would argue you shouldn’t even be thinking about for purposes of writing software—that’s another discussion I’ll save for someone else!).

    Now, you might think that it would therefore make sense to store a list of Datapoint objects much like you suggested:

    latitude  // first object
    longitude
    elevation
    latitude  // second object
    longitude
    elevation
    ...       // etc.
    

    However, as you may have learned in class already, reference types are not stored in this way in .NET. Given a collection of objects, each instance may be stored anywhere; what you have in a List<Datapoint> is actually a bunch of references to these objects, in much the same way that if I had this list:

    • 123 Main St
    • 456 Broad St
    • 789 Chestnut St

    …the buildings at these addresses would not need to actually reside next to one another.

    Hopefully this helps you to understand what a List<Datapoint> actually is: a list of references to objects, which have properties but are not traditionally thought of as lists themselves (though in some sense they are), and which may be allocated and exist at non-adjacent points in memory.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So, I inherited some code (below) from someone else and I'm trying to understand
I'm trying to understand some String class functions in Java. So, here's is a
I'm trying to understand some C++ code which has the following class syntax: class
I am a NOOB trying to understand some code. What does this self.class.current_section do?
I'm trying to understand how delegate pattern works. Below is some code that I
I am now trying to understand some code and I have found a pattern,
I've in inherited some code that I'm trying to understand and any searching I
I am trying to understand the Javascript event handling. I like some code to
i have some code that i am trying to recompile and understand, but i
I have some legacy C++ code that I am trying to understand a bit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.