Advertisement
KodingKid

Java OOP #1 - Basic Scripting #9

May 19th, 2021
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1. public class sound1 { //creates class
  2.     static boolean sound2 = 0; //creates boolean and puts it at 0
  3.     public static void soundup() { //creates a static void
  4.         sound2=++ //increases boolean
  5.         }
  6.     public static void sounddown() { //creates another static void
  7.         sound2=-- //decreases boolean
  8.         }
  9.     if sound2 > 100 { //if sound is above 100...
  10.         sound2=-- //it goes down to 100
  11.         }
  12.     if sound2 < 0 { //if sound is below 0
  13.         sound2=++  //it goes up to 0
  14.         }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement