公告
财富商城
积分规则
提问
发文
2020-06-16 02:51发布
三岁会撩人
I am new to Java ... is there a similar method to the ReadKey() in C# to avoid that a console application closes?
thanks
YOu can also use System.in.read(), if you are ok with just 'Enter' key being your exit key.
System.in.read()
One way to do it:
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br.readLine();
there are definitely shorter ones, but I think this one's convenient, because it can easily be extended.
最多设置5个标签!
YOu can also use
System.in.read()
, if you are ok with just 'Enter' key being your exit key.One way to do it:
there are definitely shorter ones, but I think this one's convenient, because it can easily be extended.