Question: Define two packages. Package 1 contalns two classes (A, B) and so also package 2 (C, D). Class A has the main method. Class
Define two packages. Package 1 contalns two classes (A, B) and so also package 2 (C, D). Class A has the main method. Class B has a private varlable x 2 and protected variable y, and one public method which returns the summation of x and y. Class D has one private variable (k) and protected method which is returned a ks. Class C has a public method to print the result of the calling method in Class D and pass a varlable to that method. Class A read the value of varlable y of class B. Class A passes the method of class B to a method print of class C.
Step by Step Solution
3.53 Rating (167 Votes )
There are 3 Steps involved in it
The following java program has been developed under Eclipse IDE Sourcecode of Class A Ajava file ins... View full answer
Get step-by-step solutions from verified subject matter experts
