I'm new to Java ... Is there a similar method for ReadKey () in C # to avoid closing the console application?
thanks
One way to do this:
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br.readLine();
there are definitely shorter ones, but I think itβs convenient because it can be easily expanded.
You can also use System.in.read() if you're ok, only the 'Enter' key is your exit key.
System.in.read()