Object Oriented Programming Lab Report
Object Oriented Programming Lab Report
ID: 203002006
Type : Assignment
Java code:
package p1;
int n = 1;
System.out.println("base constructor");
package p1;
Derived() {
System.out.println("derived constructor");
// class only
package p1;
class SamePackage {
SamePackage() {
// class only
package p2;
Protection2() {
// class only
package p2;
class OtherPackage {
OtherPackage() {
p1.Protection p = new p1.Protection();
// class only
Output:
file Protection.java : 1 2 3 4
file Derived.java: 1 3 4
file Protection2: 3 4