- This code below is a common way to get user input in the console with Java:
// Import library
import java.util.Scanner;
// main method...
// Print the input phrase
System.out.println("Enter input: ");
// Open scanner for input
Scanner scanner = new Scanner(System.in);
String userInput = scanner.nextLine();
scanner.close();
// Print the input
System.out.println(userInput);- It takes about 7 lines of code in Java when the same can be done in Python using just 2:
userInput = input("Enter input: ")
print(userInput)- Simply use the function
getString(String):
String input = makejavaeasy.getString("Enter input: ");
System.out.println(input);- Just like that, with MakeJavaEasy, you get the simplicity of Python with Java!
Get 'Make Java Easy' here