import A.C2;
import A.C3;
import B.C4;
import B.C5;
public class TestPackage {
public static void main(String[] args) {
C1.m1();
C2.m1();
C3.m1();
C4.m1();
C5.m1();
}
}
TestPackage.java output
This is A – C1.m1()
This is A – C2.m1()
This is A – C3.m1()
This is B – C4.m1()
This is B – C5.m1()
C1.java
package A;
public class C1 {
static public void m1() {
System.out.println("This is A – C1.m1()");
}
}
C2.java
package A;
public class C2 {
static public void m1() {
System.out.println("This is A - C2.m1()");
}
}
C3.java
package A;
public class C3 {
static public void m1() {
System.out.println("This is A – C3.m1()");
}
}
C4.java
package B;
public class C4 {
static public void m1() {
System.out.println("This is B – C4.m1()");
}
}
C5.java
package B;
public class C5 {
static public void m1() {
System.out.println("This is B – C5.m1()");
}
}
Tag: Study Code Program Java
No comments:
Post a Comment