Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. package bird;
  2.  
  3. public class Bird{
  4. protected name;
  5. }
  6.  
  7. package swan;
  8. import bird.Bird;
  9.  
  10. public class Swan{
  11. public void check1(){
  12. System.out.print(name);
  13. }
  14.  
  15. public void check2(){
  16. Swan swan = new Swan();
  17. System.out.print(swan.name);
  18. }
  19.  
  20. public void check3(){
  21. Bird bird = new Bird();
  22. System.out.print(name);
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement