I have a class with data member in one package. Now writing the anonymous class of the class in another package.

```
package a;
public class A{
    String data;
    void print(){
       System.out.print(data);
    }
}

```

and in another package Now making the anonymous class of A.

```
    package B;
    import a;
    class B{
    public void static main(String[] args){
        A anoy = new A(){
            void print(){
                // overriding print
                System.out.print(data + " overrided");
          }
     }
    }
   }

```

Now here I am getting an error data is not public in class A. how to access data while writing the anonymous class without changing access specifier of data to the public.