diff options
Diffstat (limited to 'tests/new/testPackage')
-rw-r--r-- | tests/new/testPackage/Class1.java | 11 | ||||
-rw-r--r-- | tests/new/testPackage/Class2.java | 7 | ||||
-rw-r--r-- | tests/new/testPackage/Import.java | 9 | ||||
-rw-r--r-- | tests/new/testPackage/subPackage/Class1.java | 7 |
4 files changed, 34 insertions, 0 deletions
diff --git a/tests/new/testPackage/Class1.java b/tests/new/testPackage/Class1.java new file mode 100644 index 000000000..d53733d34 --- /dev/null +++ b/tests/new/testPackage/Class1.java @@ -0,0 +1,11 @@ +package packagevisibility.testPackage; + +public class Class1 { + public String doIt(String s) { + return s + "-class1"; + } + + public String doItToClass2(String s) { + return (new packagevisibility.testPackage.Class2()).doIt(s); + } +} diff --git a/tests/new/testPackage/Class2.java b/tests/new/testPackage/Class2.java new file mode 100644 index 000000000..697a8c86e --- /dev/null +++ b/tests/new/testPackage/Class2.java @@ -0,0 +1,7 @@ +package packagevisibility.testPackage; + +class Class2 { + String doIt(String s) { + return s + "-class2"; + } +} diff --git a/tests/new/testPackage/Import.java b/tests/new/testPackage/Import.java new file mode 100644 index 000000000..b546ad89f --- /dev/null +++ b/tests/new/testPackage/Import.java @@ -0,0 +1,9 @@ +package testPackage; + +import testPackage.subPackage.Class1; + +public class Import extends Class1 { + public static void main( String[] args ) { + print( "here" ); + } +} diff --git a/tests/new/testPackage/subPackage/Class1.java b/tests/new/testPackage/subPackage/Class1.java new file mode 100644 index 000000000..432285125 --- /dev/null +++ b/tests/new/testPackage/subPackage/Class1.java @@ -0,0 +1,7 @@ +package testPackage.subPackage; + +public class Class1 { + static public void print( String s ) { + System.out.println( ">> " + s ); + } +} |