Question: A system has two packages: SOS and SOE. In the SOS package, there is a public class CS. In the SOE package, there is one

A system has two packages: SOS and SOE. In the SOS package, there is a public class CS. In the SOE package, there is one public superclass Department with one public subclass SE. The programs for CS and Department are shown below. Mark the println statements that can be printed in the se_method.

package SOS;

public class CS {

public int x;

double y;

private String z;

}

package SOE;

import SOS.CS;

public class Department {

public int x;

double y;

protected long w;

CS cs = new CS();

SE se = new SE();

static Department d = new Department();

}

package SOE;

public class SE extends Department{

private String z;

private void se_method( ){

}

}

If the se_method() declaration is changed to the following, mark the println statements that can be printed in the method. public static void se_method { : }

(a.)System.out.println(cs.x);
(b.)System.out.println(cs.y);
(c.)System.out.println(cs.z);
(d.)System.out.println(se.w);

(e.)System.out.println(se.x);

(f.)System.out.println(se.y);

(g.)System.out.println(se.z);
(h.)System.out.println(d.w);
(i.)System.out.println(this.w);
(j.)System.out.println(this.x);
(k.)System.out.println(this.y);
(l.)System.out.println(this.z);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!