How do we read data?
Something similar to Python
Console cons = System.console();
String username = cons.readLine("Username: ");
char[] passwd = cons.readPassword("Password: ");
More generally , we can use Scanner class
import java.util.Scanner; // Must import the Scanner class.
Scanner in = new Scanner(System.in);
String name = in.nextLine();
int age = in.nextInt();
For output in Java, use either System.out.println
or System.out.print
.