FAQ: Basic Classes and Objects - Fields

This community-built FAQ covers the “Fields” exercise from the lesson “Basic Classes and Objects”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Learn C#

FAQs on the exercise Fields

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!
You can also find further discussion and get answers to your questions over in #get-help.

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head to #get-help and #community:tips-and-resources. If you are wanting feedback or inspiration for a project, check out #project.

Looking for motivation to keep learning? Join our wider discussions in #community

Learn more about how to use this guide.

Found a bug? Report it online, or post in #community:Codecademy-Bug-Reporting

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

Apologies for the poor formatting. I don’t know how to make my double enters show up.

I am having difficulty understanding how fields and objects relate to each other. I find it helpful when these concepts are related to concepts which I am already familiar with. For example, relating a field to a variable. This is done in the explanation that I took from exercise and typed out below:

"Create fields like this:

class Forest {
public string name;
public int trees;

This might look similar to defining a variable. It is! Each field is a variable and it will have a different value for each object."

The problem is that it seems to me that the concept of object was also related to a variable in an example and explanation from the previous exercise.

This example states that ‘phrase’, a variable, is an instance of string. To me the use of the words ‘instance of string’ suggests that phrase is an object of string.
I say this because the definition of object involves the words ‘instance of a class’ and class is contrasted to the custom data types like string.

I hope this makes sense so far. Could someone please explain why I am wrong about ‘phrase’ being an object of string.

Also, if class relates to data types, and fields relate to variables, then what are objects? The values assigned to the variables?

Thank you so much if you took the time to read this.


Hey, have you since posting this found some clarity on this topic? I would love to hear your insights!

No, sorry mate. I’ve been super busy the last few weeks and so I’ve put the c# learning on hold. In a few weeks I’ll have more time and I’ll update you if I work it out :slight_smile: