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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:53:57+00:00 2026-06-12T21:53:57+00:00

I wonder what happens when I assign a static object to non-static object ?

  • 0

I wonder what happens when I assign a static object to non-static object ?
For example:

public class Test{
   public void test(){
      BoneCp cp=BoneCpLoad.getBoneCpPool();
   }
}

public class BoneCpLoad{
    private static BoneCpPool pool =new BoneCpPool();
    public static BoneCp getBoneCpPool(){
        return pool;
    }
}
  • 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-12T21:53:59+00:00Added an answer on June 12, 2026 at 9:53 pm

    Static objects actually don’t exist.

    In this case static keyword is referred to getBoneCpPool() method. This is perfectly legal and the static method returns an instance of BonceCp object.

    static modifier keyword can be applied to methods, and denotes methods that not belong to a particular instance of a class, but to the class itself.

    static modifier keyword can be applied to fields too (actually are static reference to objects). In this case denotes fields that not belong to a particular instance of a class, but are share between all class instances of the same type.

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

Sidebar

Related Questions

I wonder what is compiling, what happens when you compile? I mean yes you
wonder what's wrong <table id=tblDomainVersion> <tr> <td>Version</td> <td>No of sites</td> </tr> <tr> <td class=clsversion>1.25</td>
I wonder how calculators work with precision. For example the value of sin(M_PI) is
I sometimes wonder what happens when you submit a form multiple times and the
template <typename T> class Test { friend Test<T> & operator * (T lhs, const
I just wonder if there is some convenient way to detect if overflow happens
I've got a class called Databaseprovider and there I have a static OracleTransaction property
I know figure 2 of http://developer.android.com/guide/components/fragments.html I wonder what happens from Fragment Active when
or ecmascript but i wonder if how it actually happens depends more on the
I undestand what indexed view are but i wonder what exactly happens when the

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.