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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:18:59+00:00 2026-05-15T04:18:59+00:00

I have three classes like this. class A { public class innerB { //Do

  • 0

I have three classes like this.

class A
{
    public class innerB
       {
       //Do something
       }

    public class innerC
       {
        //trying to access objB here directly or indirectly over here. 
        //I dont have to create an object of innerB, but to access the object created by A
        //i.e.
             innerB objInnerB = objB;
        //not like this
             innerB objInnerB= new innerB();
       }

private innerB objB{get;set;}  **//Private**

public A()
   {
    objB= new innerB();
   }
}

I want to access the object of class B in Class C that is created by class A.
Is it possible somehow to make changes on object of Class A in Class C. Can i get Class A’s object by creating event or anyhow.

Edit: My mistake in asking the question above. Object of B created in A is private not public

IS IT POSSIBLE TO DO THIS BY CREATING EVENT

If anyhow I become able to raise an event that can be handled by Class A, then my problem can be solved.

  • 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-15T04:19:00+00:00Added an answer on May 15, 2026 at 4:19 am

    If I’m reading you correctly you want to access the objB property of class A within innerC WITHOUT passing it along.

    This isn’t how C# inner classes work, as described in this article: C# nested classes are like C++ nested classes, not Java inner classes

    If you want to access A.objB from innerC then you are going to have to somehow pass class A to innerC.

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

Sidebar

Related Questions

i have classes like this class A : public QDialog { A(QWidget *parent); static
I have three classes public class OSiteEquipment : IPlantItem public class OSiteSubSystem : IPlantItem
I have three different base classes: class BaseA { public: virtual int foo() =
I have a class MyClass and an inner class MyNestedClass like this: public class
Let's assume I have three classes that are subclasses of a base class: public
I have created a class which holds three classes as properties: public class Feeds
Here are three classes in my domain: public class Quote : IEntity, IAggregateRoot {
Here is what i am trying to do. I have Three Classes: 1) CEngine
I have three tables CLASSES , CHILD_CLASSES , and STUDENTS . CLASSES looks like
I have three classes; Classes A and B both reference class C . How

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.