Please read this
document[
^]
This one provides various examples on how you can declare
Improving Richard MacCutchan 's answer
package org.sd;
class Test13 {
public static void main(String args[]){
System.out.println(com.gbr.Hello.A);
System.out.println(com.gbr.Hai.A);
}
}
or
package org.sd;
import com.gbr.Hello;
import com.gbr.Hai;
class Test13 {
public static void main(String args[]){
System.out.println(Hello.A);
System.out.println(Hai.A);
}
}
or
package org.sd;
import static com.gbr.Hello.*;
import com.gbr.Hai;
class Test13 {
public static void main(String args[]){
System.out.println(A);
System.out.println(Hai.A);
}
}
or
package org.sd;
import static com.gbr.Hello.A;
import com.gbr.Hai;
class Test13 {
public static void main(String args[]){
System.out.println(A);
System.out.println(Hai.A);
}
}
Also read this to
understand ambiguity[
^]