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

The Archive Base Latest Questions

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

As per standard book constructor is a special type of function which is used

  • 0

As per standard book constructor is a special type of function which is used to initialize objects.As constructor is defined as a function and inside class function can have only two type either static or non static.My doubt is what constructor is ?

1.)As constructor is called without object so it must be static

  Test test =new  Test();//Test() is being called without object
   so must be static

My doubt is if constructor is static method then how can we frequently used this inside
constructor

Test(){
    System.out.println(this);
}

Does the output Test@12aw212 mean constructors are non-static?

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

    Your second example hits the spot. this reference is available in the constructor, which means constructor is executed against some object – the one that is currently being created.

    In principle when you create a new object (by using new operator), JVM will allocate some memory for it and then call a constructor on that newly created object. Also JVM makes sure that no other method is called before the constructor (that’s what makes it special).

    Actually, on machine level, constructor is a function with one special, implicit this parameter. This special parameter (passed by the runtime) makes the difference between object and static methods. In other words:

    foo.bar(42);
    

    is translated to:

    bar(foo, 42);
    

    where first parameter is named this. On the other hand static methods are called as-is:

    Foo.bar(42);
    

    translates to:

    bar(42);
    

    Foo here is just a namespace existing barely in the source code.

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

Sidebar

Related Questions

As per standard Array definition: An array is a variable which allows you to
Per a client's request I have written a communication class that inherits from webclient.
I have a site running MVC and Nhibernate (not fluent) using standard session per
Per http://www.assembla.com/spaces/clojure/wiki/Datatypes I should be able to type the following into a lein reply:
As per this article , I've extended the System.Windows.Forms.WebBrowser class to implement custom error-handling.
The standard Rails validation wraps my error-filled fields in a div of class fieldWithErrors
I am writing a program that generates standard alias names per table name. In
I am developing authentication system using Oauth protocol and as per the Oauth standard,
With the standard OpenCms WebDAV config, you can get a CmsVfsResourceNotFoundException error when accessing
In general ,as per C standard is it guaranteed that memset() with 0 will

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.