Advertisement
zero50x

Магнитики 2 ООП

Mar 17th, 2015
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.44 KB | None | 0 0
  1. public class DrumKit {
  2.  
  3.  boolean topHart = true;
  4.  boolean snare = true;
  5.  
  6.     void playTopHat () {
  7.         System.out.println("динь-динь");
  8.     }
  9.    
  10.     void playSnare () {
  11.         System.out.println("бабах");
  12.     }
  13. }
  14.  
  15.  
  16.  
  17.  
  18. public class DrumKitTestDrive {
  19.     public static void main (String [] args){
  20.        
  21.     DrumKit d = new DrumKit();
  22.    
  23.     d.playSnare();
  24.     d.snare == false;
  25.     d.playTopHat();
  26.        
  27.     if(d.snare == true){
  28.         d.playSnare();
  29.     }
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement