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

  • Home
  • SEARCH
  • 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 98915

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:17:15+00:00 2026-05-11T00:17:15+00:00

Somewhat unclear to me are references (pointers?) to classes in VB.NET. The question I

  • 0

Somewhat unclear to me are references (pointers?) to classes in VB.NET. The question I am about to ask can be answered by a little bit of testing, but I was wondering if anybody could post a decent explanation (or links, too).

If you create a class:

Public Class ReferenceClass      Private myBooleanValue As Boolean = False     Public Property BooleanValue As Boolean         Get             Return myBooleanValue         End Get         Set(value As Boolean)             myBooleanValue = value         End Set     End Property  End Class 

And then a class which actually uses this class as a property:

Public Class UsingClass       Private myReference As ReferenceClass      Public Property Reference As ReferenceClass         Get              return myReference          End Get          Set(value As ReferenceClass)              myReference = value          End Set      End Property       Public Sub New(ByVal Reference As ReferenceClass)          myReference = Reference      End Sub  End Class 

And then use it like this:

Public Class RuntimeOrSomething       Public Shared myReference As ReferenceClass      Public Shared ReadOnly Property Reference As ReferenceClass          Get              If myReference Is Nothing Then myReference = new ReferenceClass()              return myReference          End Get      End Property       Public Shared Function BooleanCheck() As Boolean          Reference.BooleanValue = True          Dim tempClass As New UsingClass(Reference)          tempClass.Reference.BooleanValue = False           Return (tempClass.Reference.BooleanValue = Reference.BooleanValue)      End Sub       Public Shared Sub DoNothing()           Reference.BooleanValue = True           Dim someBoolean As Boolean = BooleanCheck            ' Now Reference.Booleanvalue is 'False'      End Sub  End Class 

Now the function BooleanCheck will always return true, even though the reference is passed to the new class UsingClass ‘by value’, not by reference. So a copy of the class is not made, but the local variable myReference in UsingClass still references/points to the property Reference in RuntimeOrSomething.

How can this be explained elegantly?

  • 0 0 Answers
  • 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. 2026-05-11T00:17:16+00:00Added an answer on May 11, 2026 at 12:17 am

    A reference points to an instance of an object, it is not an instance of an object. Making a copy of the directions to the object does not create another object, it creates another reference that also points to the same object.

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

Sidebar

Ask A Question

Stats

  • Questions 67k
  • Answers 67k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer The correct answer is, you should provide both, if you… May 11, 2026 at 12:01 pm
  • added an answer You can use TableLayoutPanel as container for controls (Labels and… May 11, 2026 at 12:01 pm
  • added an answer The iPhone OS document sets are definitely available in the… May 11, 2026 at 12:01 pm

Related Questions

Somewhat unclear to me are references (pointers?) to classes in VB.NET. The question I
Somewhat related to my question about integers instead of decimals; my vendor provides a
Although somewhat related to this question , I have what I think is a
This is a somewhat low-level question. In x86 assembly there are two SSE instructions:
I have somewhat interesting development situation. The client and deployment server are inside a
Working on a somewhat complex page for configuring customers at work. The setup is
I've been somewhat spoiled using Eclipse and java. I started using vim to do
I asked a somewhat related question but I want it to make it more
I have a somewhat messily-formatted Objective-C code base. Is there a way to have
I know this is somewhat of a server question, but I wanted to ask

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.