What is the difference between closing a resource and making the scanner private in java?

前端 未结 0 1169
暗喜
暗喜 2021-01-04 11:27

private static Scanner sc;

&

sc.close();

What is the difference between these two things?

相关标签:
回答
  • 消灭零回复
提交回复
热议问题