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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:41:52+00:00 2026-06-09T07:41:52+00:00

Pretty easy question, but anyway: is there any reason to override default constructor like

  • 0

Pretty easy question, but anyway: is there any reason to override default constructor like this:

public SomeObject(){
}

It is public. It is does not have any logic. So, is there necessary? I didn’t see the whole picture?

Appreciate all your help.

  • 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-09T07:41:54+00:00Added an answer on June 9, 2026 at 7:41 am

    One reason to define an empty no-arg constructor is if there is also a non-default constructor and the no-arg constructor is still desired to be accessible (public or protected).

    This is because any [other] constructor definition will prevent the automatic addition of the default no-arg constructor:

    The compiler automatically provides a [public] no-argument, default constructor for any class without constructors.

    (See the next bit in that link as well, where it talks about the default super constructor that will be called.)

    Even if the no-arg constructor is never used manually, it can be important for other things, e.g. Serializable:

    During deserialization, the fields of non-serializable classes will be initialized using the public or protected no-arg constructor of the class. A no-arg constructor must be accessible to the subclass that is serializable. The fields of serializable subclasses will be restored from the stream.

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

Sidebar

Related Questions

This sounds like a pretty easy question to answer but I haven't been able
I am pretty new to rails so this may be an easy question, but
This is pretty easy question, but I have been unable to find the solution
This is quite simple question but I didn't find an answer: Is there any
I think this should be a pretty easy question to answer but I can't
This is probably a pretty easy to answer question, but I can't find the
Alright, so this is probably a pretty easy question to answer, but I'm struggling
OK, I know this question seems pretty easy to answer, or maybe documented, but
I think this is a pretty easy question...How do I make a asp.net function
this is prob pretty easy but if someone could explain the easiest way to

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.