Check only integer input
hasNextInt() Use hasNextInt() to check if it's integer or not while (!keyboard.hasNextInt()) { MenuViewer.keyboard.next(); //discard System.out.println("You entered character. Please, Enter a number to choose"); } Example Code while (true) { //try catch 구문이 while안에 있어야 에러처리가 끝나도 다시 메뉴를 선택할 수 있어. try { MenuViewer.menuViewer(); //Static method 이기 때문에 class name으로 호출 while (!MenuViewer.keyboard.has..
JAVA
2019. 7. 12. 05:18
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- Collection Framework
- HashMap
- Javascript Algorithm
- 프로그래머스
- substring()
- easy javascript algorithm
- hackerrank javascript solution
- Object type casting
- rest parameter
- javascript
- hackerrank javascript
- C++
- HackerRank Algorithm
- compareTo()
- math.max
- repeat()
- ... in Javascript
- 알고리즘
- code refactoring
- algorithm
- equals()
- easy algorithm
- hackerrank
- java
- spring boot application
- string class in java
- 프로그래머스 알고리즘
- math.abs
- hackerrank solution
- 프로그래머스 알고리즘문제
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
글 보관함