The console()class method Systemreturns an object Consoleif a console device is present, otherwise it returns null. The expression args.length > 0checks if argsall elements are in the String array .
public static void main(String[] args) {
Console console = System.console();
if (console != null || args.length > 0) {
}
}
source
share