Notice
                              
                          
                        
                          
                          
                            Recent Posts
                            
                        
                          
                          
                            Recent Comments
                            
                        
                          
                          
                            Link
                            
                        
                    | 일 | 월 | 화 | 수 | 목 | 금 | 토 | 
|---|---|---|---|---|---|---|
| 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 | 31 | 
                            Tags
                            
                        
                          
                          - 열거형
- enum
- 버퍼비우기
- 객체지향
- 추상화
- inheritance
- abstract
- 와일드카드
- 생성자
- 다형성
- nextInt
- 백준
- 상속
- 최소신장트리
- 제네릭
- 프림알고리즘
- polymorphism
- python
- 캡슐화
- Scanner
- 17472
- Encapsulation
- Final
- 추상 클래스
- 내부 클래스
- 객체 지향
- java
- 인터페이스
- this
                            Archives
                            
                        
                          
                          - Today
- Total
목록nextInt (1)
쫑쫑이의 블로그
      
      
        버퍼 비우기(Scanner nextInt)
        
  
  
        
    
            
            
            
            
            
            
              
            
          Scanner를 사용하여 입력값을 받는 과정 중에 다음과 같은 예시가 있으면 Scanner s = new Scanner(System.in); System.out.println("num 값 입력"); int num = s.nextInt(); System.out.println("str1 값 입력"); String str1 = s.nextLine(); // 실행 안됐다고 느껴짐 System.out.println("str2 값 입력"); String str2 = s.nextLine(); num 값을 입력하고 enter를 누르면 "str1값 입력"과 "str2 값 입력"이 연속으로 출력됐다 String str1 = s.nextLine(); 부분이 그냥 넘어가 구글링 해보니... nextInt가 버퍼에서 enter..
        공부/JAVA
        
        2022. 9. 9. 19:14
      
    