what is the difference between declaring constant in an interface and in class java
<p>1)What is the difference between two static variable below code.</p>

<pre><code>Class A{
public static final String  X = "XYZ";
}


interface A{
String X = "XYZ";
}
</code></pre>

<p>2)if both static are variable declaration  are same then which one is the efficent.</p>

<p>ie</p>

<pre><code>Class A{
public static final String  X = "XYZ";

void print(){
System.Out.Println(X);
}
}
</code></pre>

<p>OR </p>

<pre><code>interface B {
String X = "XYZ";
}


 Class A implements B{

    void print(){
    System.Out.Println(X);
    }
    }
</code></pre>
