How inheriting static fields affects the performance?
<p>Since static fields objects are created at class level(and common to all objects), Is it static import on particular fields and inheriting(using implements) all the fields will create same amount of memory? </p>

<p>For Example In this below propgram how many MyOwn objects are created?    </p>

<pre><code>class MyOwn{}

public interface ConstantIfc {
  public final static MyOwn REF = new MyOwn();
}

class A implements ConstantIfc {}
class B implements ConstantIfc {}

public class c {
   public static void main(String... arg) {
      A refA = new A();
      B refB = new B();
   }
 }
</code></pre>

<p>If it is same how final constant class for static import is better than constant interface?</p>

<p>Update: <BR>
I understood that It is better to avoid Inherittance for constants. Improperly leveraging implementation inheritance often leads to inflexible design. So we can better go for static import of class/interface. but still Interfaces are an abstraction, and to remain abstract, they should not contain implementation details (including constant variables.) Interfaces also are often used to describe a public API, in which implementation details do not belong. For this reason it makes sense to put constant data into a class, rather than an interface. Thanks robjb.</p>
