Scanner.close & Method execution
Purpose:
1) Efficient CPU management with Scanner.
2) How to execute a method and the way of running it.
1)
Once running a scanner, to prevent waste of memory loss in the CPU, we should close the scanner.
Formula :
Scanner.close();
or
sc. close();
scanner random name
2)
How to activate a method? Here is a way for it.
Formula:
Display( );
But, some values need to be input inside ( ).
String[ ][ ] menu = { { "EXIT", "프로그램을 종료합니다.~" }, 00, 01, 02
{ "MAIN", "연산하기", "끝내기" }, 10, 11, 12
{ "연산", "새로운 연산", "이어서 연산", "이전 화면" } }; 20, 21, 22
this.display(this.makeSubMenu(menu[1]));
Menu is 2 dimetional array need a 2 cell to receive 2 dfferent value into [ ], [ ].
Once setting up an array with indexes inside together, we can summon the value with a formula like the above.
without input value inside display, a method dose not work.
Comments
Post a Comment