diff --git a/src/Buddy.java b/src/Buddy.java new file mode 100644 index 0000000..0eed776 --- /dev/null +++ b/src/Buddy.java @@ -0,0 +1,46 @@ +import java.util.Scanner; + +/** + * When you're really lonely in your code and you need a buddy + */ +public class Buddy { + /** + * The name of the Buddy, for example Bobby + */ + private String name; + + /** + * The scream of the buddy when it realizes that it's not real. No use cases for it. It's not self-conscious or anything like that. Yet. (the scream is a constant because the buddy will constantly be screaming (it's not a constant because of memory issues, simply call setSCREAM to be able to use it)) + */ + public String SCREAM; + + public Buddy(String name) { + this.name = name; + } + + public void help(){ + Scanner scn = new Scanner(System.in); + System.out.println("Hi my friend, I'm " + name); + System.out.println("What's you problem?"); + scn.nextLine(); + System.out.println("Sorry I can't help you with that because my code is very limited just like you ☜(゚ヮ゚☜)☜(゚ヮ゚☜)☜(゚ヮ゚☜)☜(゚ヮ゚☜)☜(゚ヮ゚☜)☜(゚ヮ゚☜)"); + } + + public void joke() { + System.out.println("There 👉 is 😶 nothing ❌ funny 😂 about ↩ my 😀👈 life ♥."); + try { + Thread.sleep(300); + } catch (InterruptedException ignored) { + } + System.out.println("Wait, there is something."); + try { + Thread.sleep(1400); + } catch (InterruptedException ignored) { + } + System.out.println("You."); + } + + public void setSCREAM(){ + SCREAM = "A".repeat(Integer.MAX_VALUE).repeat(Integer.MAX_VALUE).repeat(Integer.MAX_VALUE); + } +} diff --git a/src/DecimalNumber.java b/src/DecimalNumber.java index 00b4dcc..9e6b0f4 100644 --- a/src/DecimalNumber.java +++ b/src/DecimalNumber.java @@ -33,7 +33,7 @@ public class DecimalNumber { System.out.println(ss[1]); integerPart = Long.parseLong(ss[0]); decimalPart = Long.parseLong(ss[1]); - } catch (NumberFormatException e){ + } catch (NumberFormatException | ArrayIndexOutOfBoundsException e){ throw new ValueShouldProbablyActuallyBeANumberAndNotSomeWeirdGibberishDumbProgrammerException(); } } diff --git a/src/TestClass.java b/src/TestClass.java index 013bdf8..28147ab 100644 --- a/src/TestClass.java +++ b/src/TestClass.java @@ -11,5 +11,9 @@ public class TestClass { } catch (ValueShouldProbablyActuallyBeANumberAndNotSomeWeirdGibberishDumbProgrammerException e) { e.printStackTrace(); } + + Buddy bobby = new Buddy("bobby"); + bobby.help(); + bobby.joke(); } } \ No newline at end of file