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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:22:19+00:00 2026-06-05T00:22:19+00:00

Below is the constructor of a struct named Complex with two member variables, Real

  • 0

Below is the constructor of a struct named Complex with two member variables, Real and Imaginary:

public Complex(double real, double imaginary) : this()
{
 Real = real;
 Imaginary = imaginary;
}

What is the use of the part after the colon in the function header?

  • 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-05T00:22:20+00:00Added an answer on June 5, 2026 at 12:22 am

    You can always make a call to one constructor from within another. Say, for example:

    public class mySampleClass
    {
        public mySampleClass(): this(10)
        {
            // This is the no parameter constructor method.
            // First Constructor
        }
    
        public mySampleClass(int Age) 
        {
            // This is the constructor with one parameter.
            // Second Constructor
        }
    }
    

    this refers to same class, so when we say this(10), we actually mean execute the public mySampleClass(int Age) method. The above way of calling the method is called initializer. We can have at the most one initializer in this way in the method.

    In your case it going to call default constructor without any parameter

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

Sidebar

Related Questions

This is really two questions, noted below: Currently I have some public internal helper
In the constructor below, I have initialized only two of the variables, leaving some
I have the below prog Object.prototype.inherit = function(baseConstructor) { this.prototype = (baseConstructor.prototype); this.prototype.constructor =
had a two part question with regard to below contrived c++ code snippet :
This is a simplified version of some of my code: public struct info {
I am using a structure in my program as below: public struct chromo_typ {
I wonder if there is something wrong with the copy constructor function below? class
Below I am creating an object in JavaScript. Within the constructor I am setting
In the class below, only the second constructor takes a ForumThread object. Otherwise, it
Why is the Child class's converter constructor called in the code below? I mean,

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.