Skip to content

Instantly share code, notes, and snippets.

@virejdasani
Last active March 20, 2021 07:27
Show Gist options
  • Save virejdasani/b39af8d9f0c4cfda15d1429e03b922ed to your computer and use it in GitHub Desktop.
Save virejdasani/b39af8d9f0c4cfda15d1429e03b922ed to your computer and use it in GitHub Desktop.
Make Java Easy is a library that makes Java as easy as Python

Make Java Easy

A Library that makes writing Java as easy to write as Python!

What it does

  • 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)

Make Java Easy solves this problem!

  • Simply use the function getString(String):
String input = makejavaeasy.getString("Enter input: ");
System.out.println(input);

Voila!

  • Just like that, with MakeJavaEasy, you get the simplicity of Python with Java!

Get 'Make Java Easy' here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment