SHARE
TWEET

Untitled

a guest Jun 19th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. openCar
  2. closeCar
  3. isTheCarOpen:boolean
  4.      
  5. class Car {
  6.     private boolean doorOpened;
  7.  
  8.     public void openCar() {
  9.         doorOpened = true;
  10.         System.out.println("Car has been opened");
  11.     }
  12.  
  13.     public void closeCar() {
  14.         doorOpened = false;
  15.         System.out.println("Car has been closed");
  16.  
  17.     }
  18.  
  19.     public boolean isTheCarOpen() {
  20.         return doorOpened;
  21.     }
  22. }
  23.      
  24. public class Car {
  25.   private boolean doorOpen = false;
  26.  
  27.   public void openCar() {
  28.     doorOpen = true;
  29.   }
  30.  
  31.   public boolean isDoorOpen() {
  32.     return doorOpen;
  33.   }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top