일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Android
- 백준
- intent
- 알고리즘
- Java
- service
- ubuntu
- git
- 16197
- Algorithm
- broadcastreceiver
- 안드로이드
- 데이터
- 프로그래머스
- IntelliJ
- 제어반전
- Jenknis
- 큐빙
- spring
- vscode
- data
- insert
- goland
- 단축키
- mysql
- 두 동전
- github
- 17837
- 데이터전달
- activity
- Today
- Total
목록Java (2)
해보자
Deque add 원소 추가(push) add(E e) : 마지막 자리(rear)에 push addFirst(E e) : 첫번째 자리(front)에 push addLast(E e) : 마지막 자리(rear)에 push iterator로 원소 접근(C++과 달리 index접근이 불가능하다.) public static void main(String[] args) { Deque dq = new ArrayDeque(); dq.add("add : 1"); dq.add("add : 2"); dq.addFirst("First : 3"); dq.addLast("Last : 4"); Iterator it = dq.iterator(); while(it.hasNext()) System.out.println(it.next()..

ls명령어 ls 명령을 실행하면 현재 디렉토리에 있는 파일 목록을 출력한다. 소스코드 1 2 3 4 5 6 7 8 9 10 11 12 import java.io.File; public class DirectoryList { public static void main(String[] args) { // 1. ls명령어 String path = System.getProperty("user.dir") ; // 현재 프로젝트 파일 디렉토리 경로 File file = new File(path); String[] strs = file.list(); for(String str : strs) System.out.println(str); } } Colored by Color Scripter cs 결과 : ls -F 명령..