Advertisement
Guest User

Untitled

a guest
May 24th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. Imagine two planets with two species, human and martian...
  2. Earth(){
  3. Human human = new Human();
  4. }
  5. Mars(){
  6. Martian martian = new Martian();
  7. }
  8. In this scenario, only Earth planet can see the human because the human is within the {} brackets, same goes for Mars. These are known as local variables. Now if we want to see the martian from the Earth planet, we would first need to access the Mars planet then the martian. Mars().martian...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement