public static boolean isConsolePresent(){
  return System.console() != null;
}

public static boolean isConsolePresent ( ) { return System . console ( ) != null ; }
will return whether the program has a console present , or was launched without
