- package j12;
- import java.util.*;
-
-
- class A{
- static int x[]=new int[100];
- static void ins(int location, int value){
- x[location]=value;
- }
- }
-
- class B{
- A a= new A();
- void xb(int location,int value){
- a.x[location]=value;
- }
- int pb(int location){
- return a.x[location];
- }
- }
-
- public class j13 {
- public static void main(String args[]) {
- B b= new B();
- b.xb(0,1);
- b.xb(1,2);
- System.out.println(b.pb(0)); //1
- System.out.println(b.pb(1)); //2
- System.out.println(b.pb(2)); //3
- }
- }