diff --git a/Gabriel-Java-Learning/src/com/p4ddy/java_tutorial/InputReader.java b/Gabriel-Java-Learning/src/com/p4ddy/java_tutorial/InputReader.java new file mode 100644 index 0000000..ea0adc9 --- /dev/null +++ b/Gabriel-Java-Learning/src/com/p4ddy/java_tutorial/InputReader.java @@ -0,0 +1,13 @@ +package com.p4ddy.java_tutorial; + +import java.util.Scanner; + +public class InputReader { + public static String getInput(String textToAsk){ + Scanner myObj = new Scanner(System.in); // Create a Scanner object + System.out.println(textToAsk); + + String input = myObj.nextLine(); // Read user input + return input; + } +}