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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:29:12+00:00 2026-05-25T00:29:12+00:00

Public Class A Private aa As Integer Dim bb As Integer Public cc As

  • 0
Public Class A
    Private aa As Integer
    Dim bb As Integer
    Public cc As Integer
End Class

Public Class B
    Inherits A

    Private dd As Integer
    Dim ee As Integer
    Public ff As Integer
End Class

Public Class C
    Dim oA As New A
End Class

what is the size of the object oA?
and what if Class A and B contain methods?(I meant the size of object)
what if inherited class B contains overridden methods?(size of object)
what if inherited class B contains variables with same name as in Class A?(size of object)

I need theoretical answer. Does those access specifiers Private,Dim,Public make any difference in allocating memory because of their different scopes?
On what basis memory is allotted for a method? etc.

  • 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-05-25T00:29:13+00:00Added an answer on May 25, 2026 at 12:29 am
    • oA is a variable holding a reference, not an object; the size of a reference depends on the platform, but is generally 4 bytes on x86 and 8 bytes on x64
    • the object referenced by oA is of type A, and has 3 integers, so the size is 12 bytes plus the standard object header
    • methods do not impact object size (no matter whether they are direct or inherited)
    • an instance of type B has 6 integers (3 directly, 3 inherited from A); any name overlaps do not impact the fact that they exist – so the size is 24 bytes plus the standard object header
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<AttributeUsage(AttributeTargets.Property)> _ Private Class CustomAttrib Inherits Attribute Public Property DataTypeLength As Integer End Class
Here's my binding source object: Public Class MyListObject Private _mylist As New ObservableCollection(Of String)
Suppose I have a class public class MyClass { private Set<String> set = new
Consider this: public class TestClass { private String a; private String b; public TestClass()
As an example: public class Foo { private Foo() {} } public class Bar
Imports System.Data.OleDb Public Class Log Private mConnectionString As String = Provider=OraOLEDB.Oracle;Data Source=(DESCRIPTION=(CID=GTU_APP)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=xxx)(PORT=1521)))(CONNECT_DATA=(SID=xxx)(SERVER=DEDICATED)));User Id=xxx;Password=xxx; Dim
Please consider this example class: [Serializable] public class SomeClass { private DateTime _SomeDateTime; public
So I have the following: public class Singleton { private Singleton(){} public static readonly
here is my example code: Public Class Parent Private _TestProperty As String Private WithEvents
I have a class which looks something like this: public class Test { private

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.