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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:00:46+00:00 2026-06-13T03:00:46+00:00

This question is really confusing A ________ is a special method that has the

  • 0

This question is really confusing

A ________ is a special method that has the same name as the class and is invoked automatically whenever an object of the class is instantiated.
Answers:

  • constructor

  • setter

  • getter

  • static method

I was thinking constructor is the only with the same name as the class, but wait! constructor is not really a method, it differs from method.
So i read this article and came to a conclusion that this question is wrongly formatted, am I right?

  • 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-13T03:00:47+00:00Added an answer on June 13, 2026 at 3:00 am

    Constructors are in fact a special method, that are used to initialize the state of the newly created instance. When you create an instance like:-

    A obj= new A();
    

    Then, the instance of class A is created using new keyword, and then the constructor A() is invoked on that newly created instance.

    Further from that article that says: –

    Constructors have one purpose in life: to create an instance of a
    class.

    No this is wrong. Constructor don’t create instance, its the new keyword that does it. And then constructor initializes the state of the instance created as I stated above.

    From JLS - Section 8.8: –

    Constructors are invoked by class instance creation expressions
    (§15.9), by the conversions and concatenations caused by the string
    concatenation operator + (§15.18.1), and by explicit constructor
    invocations from other constructors (§8.8.7).

    Constructors are never invoked by method invocation expressions
    (§15.12).

    Also from oracle tutorial

    Point originOne = new Point(23, 94);

    The above statement has three parts (discussed in detail below):

    Declaration: The code set in bold are all variable declarations that
    associate a variable name with an object type.
    Instantiation: The new keyword is a Java operator that creates
    the object.
    Initialization: The new operator is followed by a call to a constructor,
    which initializes the new object.

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

Sidebar

Related Questions

Sorry if this question is confusing. I have inherited a site that is already
This question is really basic. What is the performance difference between removing a UIView
I think this question is really about my understanding of Garbage collection and variable
After ages of programming in php this question seems really weird still to me.
I'm definitive new on Dynamic CRM 2011, so maybe this question is really easy.
I know this question is not really important.. however I've been wondering: Which of
This is a simple question really (but I couldn't seem to find the answer
This is a simple question really. I've been using the new type of constructors
This question might be closed as it sounds vague but I'm really asking this
This post asks this question but doesn't really give an answer, so I thought

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.