Consider the above package diagram. It has three packages. Answer the following
ID: 3848518 • Letter: C
Question
Consider the above package diagram. It has three packages. Answer the following questions: To which class (es), class Student has access/visibility? To which class(es), Class Course has access/visibility? To which class (es), Class Schedule has access/visibility? To which class(es), Class Application has access/visibility? Consider the of the use case 'Make machine rent" of an online system (next page). If you want the complete description of the system, and the use case diagram, these are also available in Appendix A. Propose a design sequence diagram of this use case. The corresponding design class gram is provided for your use.Explanation / Answer
**Note: Image is not clear still I am trying to answer this question. Please let me know if you have any doubt or if you have any concern for the explanbation.
1. a) Class Student has the access to all the classes present in in Program package. Reason for this is class Student Import the tha package Program so it can access or create instance of all the classes present under package Program without considering Java Access Modifier.
package com.admin;
import com.program.*;
public class Student {
public static void main(String[] args) {
Course c = new Course();
Job j = new Job();
}
}
b) Class Course has the access only to class Reasult. Reason for this is class Course Import directly class Result so it can access or create instance of class Result without considering Java Access Modifier.
package com.program;
import com.exam.Result;
public class Course {
public static void main(String[] args) {
Result r = new Result();
}
}
c) Class Schedule has the access to all the classes present in in Program package. Reason for this is class Schedule Import the tha package Program so it can access or create instance of all the classes present under package Program without considering Java Access Modifier
package com.exam;
import com.program.*;
public class Schedule {
public static void main(String[] args) {
Course c = new Course();
Job j = new Job();
}
}
d) Class Application dont have access to any classes as it is not importing any package or specific class.
package com.admin;
public class Application {
public static void main(String[] args) {
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.