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 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 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"); + } +}