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 9206769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:14:43+00:00 2026-06-18T00:14:43+00:00

This is embarrassing. I learned C# a long time ago and am just now

  • 0

This is embarrassing. I learned C# a long time ago and am just now attempting to understand this question about classes (since they are reference types, of course).

Here’s the question: If I create two new instances of a class called Person and named one instance P and the other Q (who cares why I’d call it Q) and set P.Name to "James" and then set Q.Name to "Suzie", would P.Name be set to "Suzie"? Or am I not understanding this correctly?

Thanks everyone

Thanks everyone for helping me with this. I assumed what was explained to me was the case. But the explanations in the tutorials I read weren’t clear and I haven’t had a computer in a few months so as to have tested it out myself.

P.s I chose the first right answer that was clear to me. But noticed several. Thanks again for everyone’s 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-18T00:14:44+00:00Added an answer on June 18, 2026 at 12:14 am

    The short answer is NO, changing Q.Name will no affect P.Name. As in

     var p = new Person();
     var q = new Person();
     p.Name = "James";
     q.Name = "Suzie";
    

    However, if q points to the p instance, then changing q would also change p. As in:

     var p = new Person();
     var q = p;
     p.Name = "James";
     q.Name = "Suzie";
    

    Both q and q Name are now “Suzie”.

    With data initialisers you can write the first example as:

    var p = new Person { Name = "James" };
    var q = new Person { Name = "Suzie" };
    

    which I think is much easier to read.

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

Sidebar

Related Questions

This is a simple HTML question, made more embarrassing (and harder to google) since
now this is embarrassing. I'm writing quick script and I can't figure out why
Sorry, another super basic ASP.NET question. this so embarrassing. I am reading the article
This is very embarrassing: a few months ago I registered my a credit card
This is an embarrassing question, but even the well-written documentation provided with boost.interprocess hasn't
Kinda of embarrassing to ask this question after few years working with Hibernate... I
This is probably embarrassing short-sighted or just completely wrong, but I've made a header.php
This is quite embarrassing, but every time i use plot() with IPython it pop's
This question is almost embarrassing to ask, but I can't find the answer in
It's little embarrassing to ask this question. But I can't figure out a way

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.