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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:28:06+00:00 2026-06-14T10:28:06+00:00

If you have a parent class which uses the @PostConstruct annotation and you create

  • 0

If you have a parent class which uses the @PostConstruct annotation and you create a child class that derives from it. Will the @PostConstruct method be called automatically each time an instance of the child class is created? since that @PostConstruct method is called each time an instance of the the parent is created.

I Know that in the child class it calls super(); for us automatically without us having to call it.

im just not sure if the @PostConstruct annotation is automatically called if that child class calls the super(); constructor.

  • 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-14T10:28:07+00:00Added an answer on June 14, 2026 at 10:28 am

    After testing this scenario, the @PostConstruct method in the base class WILL automatically be called.

    The flow goes like this:

    1. When the child class is created, you are in the constructor of the child class, you then are forced into the parent class automatically.
    2. Once the parent class constructor is done you are sent back to the child class’ constructor.
    3. Once the child class constructor is done you are automatically sent to the PARENT classes @PostConstruct method
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a MustInherit Parent class with two Child classes which Inherit from the
I have a parent class which contains a child object. I am using set
I have a parent class and child class (inherited from parent). In the child
In Django, when you have a parent class and multiple child classes that inherit
PROBLEM: I have a Child class which uses DataContractSerialization and raises a Changed event
I have this code that uses a template parent class A that has one
A short summary of the question: I have a parent class which is extended
I have one parent class, which is abstract class for now, for four different
I have a parent class Parent and a child class Child , defined thus:
I have a Parent/Child object/mapping as follows: class Parent { int Id; string name;

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.