Advertisement
joxaren

huita

May 23rd, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.83 KB | None | 0 0
  1. import java.io.*;
  2. import java.util.ArrayList;
  3. import java.util.Random;
  4.  
  5. public class Asshole {
  6.  
  7.     protected String name;
  8.  
  9.     public String getUserInput(String prompt) {
  10.         String inputLine = null;
  11.         System.out.print(prompt + " ");
  12.         try {
  13.             BufferedReader is = new BufferedReader(
  14.                     new InputStreamReader(System.in));
  15.             inputLine = is.readLine();
  16.             if (inputLine.length() == 0) return null;
  17.         } catch (IOException e) {
  18.             System.out.println("IOException: " + e);
  19.         }
  20.         return inputLine;
  21.     }
  22.     private ArrayList<String> absorbHostility() {
  23.         ArrayList<String> accumulatedInsults = new ArrayList<>();
  24.         String userInput = getUserInput("got anything to say, faggot?");
  25.         while (!"enough".equals(userInput)) {
  26.             accumulatedInsults.add(userInput);
  27.         }
  28.         return accumulatedInsults;
  29.     }
  30.  
  31.     public void saySomethingRude() {
  32.         Random random = new Random();
  33.         String nameOfTheVictim = getUserInput("wut's ur name, mate?");
  34.         ArrayList<String> insultList = absorbHostility();
  35.         System.out.println("NO " + insultList.get(random.nextInt(insultList.size())).toUpperCase() + ".");
  36.         System.out.println("How did you like the taste of your own medicine, " + nameOfTheVictim + "?");
  37.     }
  38. }
  39.  
  40. ___________________________
  41. public class Dota2Player extends Asshole {
  42.  
  43.     public Dota2Player(String name) {
  44.         this.name = name;
  45.     }
  46.  
  47.     public void saySomethingRude() {
  48.         super.saySomethingRude();
  49.         System.out.println("overridden yo");
  50.     }
  51. }
  52. __________________________
  53. public class Confrontation {
  54.     public static void main(String[] args) {
  55.         Dota2Player pd = new Dota2Player("pussyDestroyer2016");
  56.         pd.saySomethingRude();
  57.     }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement