Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package bird;
- public class Bird{
- protected name;
- }
- package swan;
- import bird.Bird;
- public class Swan{
- public void check1(){
- System.out.print(name);
- }
- public void check2(){
- Swan swan = new Swan();
- System.out.print(swan.name);
- }
- public void check3(){
- Bird bird = new Bird();
- System.out.print(name);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement