From 5c6c20729220602bc56b73f2d3a07dc55630f839 Mon Sep 17 00:00:00 2001 From: xbr01 Date: Sat, 13 May 2023 18:12:29 +0530 Subject: [PATCH 1/3] First Java file --- check.java | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 check.java diff --git a/check.java b/check.java new file mode 100644 index 0000000..171b4f0 --- /dev/null +++ b/check.java @@ -0,0 +1,5 @@ +public class first { + public static void main(String[] args) { + System.out.println("Hello Worlddddddddd"); + } +} From b85b2fa8adbe76bad3623a85c29d9f89cd640131 Mon Sep 17 00:00:00 2001 From: Abhiram <115929261+xbr01@users.noreply.github.com> Date: Sat, 13 May 2023 19:08:31 +0530 Subject: [PATCH 2/3] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 526e9b1..d70e50b 100644 --- a/README.md +++ b/README.md @@ -1 +1,3 @@ -# Java \ No newline at end of file +# Java + +Java programs dump From 4a16839fed60781362ae9f016720ac478ecc5f42 Mon Sep 17 00:00:00 2001 From: xbr01 Date: Sun, 14 May 2023 13:20:34 +0530 Subject: [PATCH 3/3] HackeRank --- Solution.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Solution.java diff --git a/Solution.java b/Solution.java new file mode 100644 index 0000000..61b91a2 --- /dev/null +++ b/Solution.java @@ -0,0 +1,16 @@ +import java.util.Scanner; + +public class Solution { + + public static void main(String[] args) { + Scanner scan = new Scanner(System.in); + int i = scan.nextInt(); + double d = scan.nextDouble(); + scan.nextLine(); // Basically everytime you go to a different variable you have hit enter, and the computer reads that as '\n' and puts that in the buffer, and when you go for double to string, that \n gets put on the string and doesnt record anything you write, this extra nextline is to 'waste' the \n you did when changing from double to string. + String s = scan.nextLine(); + + System.out.println("String: " + s); + System.out.println("Double: " + d); + System.out.println("Int: " + i); + } +} \ No newline at end of file