일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Python
- 프로그래머스스쿨
- 저장소
- 자바스크립트
- synchronized
- JS
- GIT
- 객체
- class
- event
- docker
- thread
- 메소드
- 파이썬
- c#
- Swing
- join()
- 스프링부트
- SpringBoot
- 자바
- SSL
- Dict
- 클래스
- Java
- StringBuilder
- array
- Docker Desktop
- 배열
- AssertJ
- JavaScript
- Today
- Total
목록전체 글 (94)
정리노트
sleep(long miliseconds) sleep(long miliseconds, int nanos) // 나노초 단위로 지정 package sleepTest; public class SleepTest { public static void main(String[] args) throws InterruptedException { String messages[] = { "A", "B", "C", "D"}; for (int i = 0; i < messages.length; i++) { Thread.sleep(4000);// 4초 간격 한 문장씩 출력 System.out.println(messages[i]); } } } package joinTest; public class JoinTest extends T..

package q11; import java.io.*; import java.util.*; public class Q11 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new FileReader("--경로입력--\\word.txt")); String str; ArrayList wordList = new ArrayList();// 파일내의 모든 단어를 리스트화, 추후 랜덤으로 단어 하나 선택 Random rd = new Random(); while ((str = br.readLine()) != null) { wordList.add(str); } String result = ..

확장명이 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..
package q10; import java.util.HashSet; import java.util.Random; public class Q10 { public static void main(String[] args) { Random rd = new Random(); int num; HashSet lotto = new HashSet(); for (int i = 0; i < 6; i++) { num = rd.nextInt(1, 46); // 1 ~ 45 if (lotto.contains(num)) // 중복확인, i--로 총 6개의 숫자가 들어가도록 함. i--; else { lotto.add(num); } } System.out.println("result = " +lotto); } }
package q7; import java.util.HashMap; public class Q7 { public static void main(String[] args) { String names[] = { new String("Kim"), new String("Kim"), new String("Choe"), new String("Park"), new String("Kim"), new String("Lee"), new String("Park") }; HashMap map = new HashMap(); for (String key : names) { map.put(key, map.getOrDefault(key, 0)+1); // getOrDefault(Key값, Default값) } System.out.p..

패키지 안에 -이름, 연락처, 주소를 생성하는데 사용할 클래스 -스윙 / Main 클래스 두 가지로 나누어서 진행 ArrayList로 객체배열 생성 // 연락처에 필요한 정보를 생성자로 담은 class package phonebook; import java.util.ArrayList; class Phonebook{ String name, tel, address; Phonebook(String n, String t, String a) { name = n; tel = t; address = a; } Phonebook(String n, String t) { name = n; tel = t; } Phonebook(String n) { name = n; } } // 스윙 , Main class package ph..

사용 이벤트 mouseClicked 버튼 - ActionListener 버튼 객체배열 사용 가위바위보를 클릭할 때 마다 결과가 나타나고 컴퓨터의 결과는 색상으로 표시. 유저와 컴퓨터의 버튼 색상은 고정되었다가 새로 버튼을 클릭하면 바뀐다. package q11; import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.util.Random; class Q11 extends JFrame { Random rd; JLabel title, vs, l1, l2, result; JButton uB[]; JButton cB[]; String bT[] = {"가위", "바위", "보"}; Q11() { setTitle("가위바위보"); ..