From 096c4020f31a074b5d58b5a0b8c801ac71ef681d Mon Sep 17 00:00:00 2001 From: Abbey Date: Sun, 19 Oct 2025 21:03:45 +0800 Subject: [PATCH 1/2] docs: add AbbeyIT to README contributors list --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 791a2e2c..f3bab848 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,7 @@ In this repository, you can find the solutions (as source code) for the problems | [Nauman Chaudhary](https://github.com/nauman-chaudhary)
| Pakistan | Python | | | [Gourav Rusiya](https://github.com/GouravRusiya30)
| India | Java | https://www.hackerrank.com/gouravrusiya786 | | [Trushita Maurya](https://github.com/trushita23)
| India | Java +| [Abbey Santos](https://github.com/AbbeyIT)
| Philippines | Java | | ### License [![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://github.com/ows-ali/Hacktoberfest/blob/master/LICENSE) From 3ed78514a9e98120e6bd5cc40f2ab320081c5d24 Mon Sep 17 00:00:00 2001 From: Abbey Date: Sun, 19 Oct 2025 21:04:27 +0800 Subject: [PATCH 2/2] feat: add Java Singleton solution from HackerRank --- Hackerrank/java-singleton.java | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Hackerrank/java-singleton.java diff --git a/Hackerrank/java-singleton.java b/Hackerrank/java-singleton.java new file mode 100644 index 00000000..1f1fd3ee --- /dev/null +++ b/Hackerrank/java-singleton.java @@ -0,0 +1,28 @@ +import java.io.*; +import java.util.*; + +class Singleton { + public static Singleton instance = null; + public String str; + + private Singleton() {} + + public static Singleton getSingleInstance() { + if (instance == null) { + instance = new Singleton(); + } + return instance; + } +} + +public class Solution { + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + String input = sc.nextLine(); + + Singleton s = Singleton.getSingleInstance(); + s.str = input; + + System.out.println("Hello I am a singleton! Let me say " + s.str + " to you"); + } +} \ No newline at end of file