CODE_TOLD_FAST

Java/TroubleMaker.java

Jan 24th, 2020
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.97 KB | None | 0 0
  1. //*******************************************************************
  2. // Welcome to CompileJava!
  3. // If you experience any issues, please contact us ('More Info')  -->
  4. //*******************************************************************
  5.  
  6. import java.lang.Math; // headers MUST be above the first class
  7.  
  8. // one class needs to have a main() method
  9. public class HelloWorld
  10. {
  11.   // arguments are passed using the text field below this editor
  12.   public static void main(String[] args)
  13.   {
  14.    
  15.     Duck duck = new Duck();
  16.     Goose goose = new Goose();
  17.    
  18.     duck.FuckShitUp();
  19.     goose.FuckShitUp();
  20.    
  21.     duck.GetDrunkAndFuckShitUp();
  22.     goose.GetDrunkAndFuckShitUp();
  23.    
  24.     System.out.print("\n\n");
  25.    
  26.     duck.GetDrunkAndFuckShitUp_ButDefinedInBaseClass();
  27.     goose.GetDrunkAndFuckShitUp_ButDefinedInBaseClass();
  28.    
  29.     TroubleMaker d = duck;
  30.     TroubleMaker g = goose;
  31.     d.GetDrunkAndFuckShitUp_ButDefinedInBaseClass();
  32.     g.GetDrunkAndFuckShitUp_ButDefinedInBaseClass();
  33.     d.GetDrunkAndFuckShitUp();
  34.     g.GetDrunkAndFuckShitUp();
  35.    
  36.   }
  37. }
  38.  
  39. public class TroubleMaker{
  40.   public void FuckShitUp(){ System.out.print("[Who Am I? *Existential Crisis* *Cries And Lights House On Fire*]\n"); }
  41.  
  42.   public void GetDrunkAndFuckShitUp(){
  43.     System.out.print("[THIS_SHOULD_BE_OVERRIDDEN]");
  44.   }
  45.  
  46.   public void GetDrunkAndFuckShitUp_ButDefinedInBaseClass(){
  47.     System.out.print("[Drinking Unspecified Type Of Alcohol...]\n");
  48.     FuckShitUp();
  49.   }
  50. }
  51.  
  52. public class Duck extends TroubleMaker{
  53.     @Override public void FuckShitUp(){ System.out.print("[DUCK:VANDALIZE!]\n"); }
  54.  
  55.   @Override public void GetDrunkAndFuckShitUp(){
  56.     System.out.print("[Drinking Vodka...]");
  57.     FuckShitUp();
  58.   }
  59. }
  60.  
  61. public class Goose extends TroubleMaker{
  62.     @Override public void FuckShitUp(){ System.out.print("[GOOSE:ATTACK!]\n"); }
  63.  
  64.   @Override public void GetDrunkAndFuckShitUp(){
  65.     System.out.print("[Drinking Gin...]");
  66.     FuckShitUp();
  67.   }
  68. }
Add Comment
Please, Sign In to add comment