Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import java.util.ArrayList;
- import java.util.Random;
- public class Asshole {
- protected String name;
- public String getUserInput(String prompt) {
- String inputLine = null;
- System.out.print(prompt + " ");
- try {
- BufferedReader is = new BufferedReader(
- new InputStreamReader(System.in));
- inputLine = is.readLine();
- if (inputLine.length() == 0) return null;
- } catch (IOException e) {
- System.out.println("IOException: " + e);
- }
- return inputLine;
- }
- private ArrayList<String> absorbHostility() {
- ArrayList<String> accumulatedInsults = new ArrayList<>();
- String userInput = getUserInput("got anything to say, faggot?");
- while (!"enough".equals(userInput)) {
- accumulatedInsults.add(userInput);
- }
- return accumulatedInsults;
- }
- public void saySomethingRude() {
- Random random = new Random();
- String nameOfTheVictim = getUserInput("wut's ur name, mate?");
- ArrayList<String> insultList = absorbHostility();
- System.out.println("NO " + insultList.get(random.nextInt(insultList.size())).toUpperCase() + ".");
- System.out.println("How did you like the taste of your own medicine, " + nameOfTheVictim + "?");
- }
- }
- ___________________________
- public class Dota2Player extends Asshole {
- public Dota2Player(String name) {
- this.name = name;
- }
- public void saySomethingRude() {
- super.saySomethingRude();
- System.out.println("overridden yo");
- }
- }
- __________________________
- public class Confrontation {
- public static void main(String[] args) {
- Dota2Player pd = new Dota2Player("pussyDestroyer2016");
- pd.saySomethingRude();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement