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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:48:31+00:00 2026-05-23T20:48:31+00:00

This is easy to work around, but I just curious if I could be

  • 0

This is easy to work around, but I just curious if I could be using a language feature or possibly the fact that the language disallows it means I’m making a logical error in class design.

I’m doing a self review of my code to help “harden” it for re-use and I just came accross:

public partial class TrackTyped : Component
{
    IContainer components = null;

    public TrackTyped()
        : base()
    {
        InitializeComponent();
    }

    public TrackTyped(IContainer container)
        : base()
    {
        container.Add(this);
        InitializeComponent();
    }
}

What I usually do when I see the same line of code in two constructors is make one call the other with “this()” but I can’t seem to do it.

If I read the spec right (I just started trying to read the spec so I may not be right):

10.11 Instance Constructors
   constructor-declarator:
      identifier   (   formal-parameter-listopt   )   constructor-initializeropt
   constructor-initializer:
      :   base   (   argument-listopt   )
      :   this   (   argument-listopt   )

It’s saying I can only have one of those.

QUESTION: is 10.11 implying that there’s no reason to need to call both or is it simply implying that the language only supports calling one?

  • 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-23T20:48:33+00:00Added an answer on May 23, 2026 at 8:48 pm

    There is no need to call both, because this redirects to another constructor that will call base.

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

Sidebar

Related Questions

In theory this seems easy but I just can't get my head around this...
I just tried the tooltip like this Easy image preview ... But i cant
I feel like this is easy but I am missing something... Using jQuery, I
I suspect there's probably an easy answer to this I'm just not seeing, but
This is hopefully a quick/easy one. I know a way to work around this
Getting friends of friend are pretty easy, I got this which seems to work
I bet this is easy but been trying for a while and can't seem
I am sure this is easy - but I can't figure it out right
I'm currently writing something to work around this Java bug: https://bugs.java.com/bugdatabase/view_bug?bug_id=5049299 Basically, I've got
This seems like an easy problem to solve, but it's kickin my ass. The

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.