일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 파이썬
- StringBuilder
- Swing
- c#
- Python
- synchronized
- 저장소
- 객체
- 자바스크립트
- SSL
- event
- AssertJ
- 프로그래머스스쿨
- join()
- 배열
- docker
- class
- Dict
- thread
- array
- 스프링부트
- Docker Desktop
- 클래스
- 자바
- 메소드
- GIT
- JavaScript
- JS
- SpringBoot
- Java
- Today
- Total
목록scanner (2)
정리노트

확장명이 java 인 파일들의 이름을 출력 후 실행하고 해당 파일내에 class 라는 단어가 들어가는 해당 줄의 번호와 모든 글자를 출력. package q8; import java.io.*; import java.nio.*; import java.util.*; public class Q8 { public static void main(String[] args) throws IOException { Scanner sc; File file = new File("//파일경로입력-----------------q"); String fileNames[] = file.list(); String javaFile; int count; for (String str : fileNames) { String ext = str..

Q1) 1부터 100 사이의 난수 10개를 받고 List에 추가하기. Q2) 리스트에 추가할 값의 개수를 입력받아 리스트의 index 범위를 미리 지정하고 해당 index에 값을 넣기 // 리스트를 생성시 범위자리에 입력을 받을 변수를 넣는다. ArrayList sum_list = new ArrayList(num); import java.util.ArrayList; import java.util.Scanner; public class p301_1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.print("입력할 값의 개수 : "); int num = sc.nextInt(); ArrayLis..