์ „์ฒด ๊ธ€

์ฝ”๋”ฉํ…Œ์ŠคํŠธ ์ค€๋น„ ๋ธ”๋กœ๊ทธ: https://velog.io/@chaerlo127
๐Ÿ’ป BufferedReader/BufferedWriter - Buffer๋ฅผ ํ†ตํ•ด ์ฝ๊ณ  ์“ฐ๋Š” ํ•จ์ˆ˜ - ์ค‘๊ฐ„์— ๋ฒ„ํผ๋ง์ด ๋œ ํ›„์— ์ „๋‹ฌ - ์†๋„๊ฐ€ ๋น ๋ฅด๋‹ค. ๋ชจ์•„๋‘์—ˆ๋‹ค๊ฐ€ ํ•œ ๋ฒˆ์— ์ „์†กํ•˜๋Š” ๊ฒƒ์ด ํ›จ์”ฌ ๋” ํšจ์œจ์  ๐Ÿ’ป BufferedReader Scanner๋Š” ๋„์–ด์“ฐ๊ธฐ, ์—”ํ„ฐ๋ฅผ ๊ฒฝ๊ณ„๋กœ ์ž…๋ ฅ ๊ฐ’์„ ์ธ์‹ํ•˜๊ธฐ ๋•Œ๋ฌธ์— ๋”ฐ๋กœ ๊ฐ€๊ณตํ•  ํ•„์š”๊ฐ€ ์—†์–ด์„œ ์‚ฌ์šฉํ•˜๊ธฐ ํŽธ๋ฆฌ BufferedReader๋Š” ์—”ํ„ฐ๋งŒ์œผ๋กœ ๊ฒฝ๊ณ„๋กœ ์ธ์‹ํ•˜๊ณ , ๋ฐ›์€ ๋ฐ์ดํ„ฐ๊ฐ€ String์œผ๋กœ ๊ณ ์ •๋˜์–ด ๋ฐ์ดํ„ฐ๋ฅผ ๋”ฐ๋กœ ๊ฐ€๊ณตํ•ด์•ผ ํ•จ. ํ•˜์ง€๋งŒ Scanner๋ณด๋‹ค BufferedReader๊ฐ€ ์ƒ๋Œ€์ ์œผ๋กœ ๋น ๋ฅด๋‹ค. - Method readLine() : ๋ผ์ธ ๋‹จ์œ„๋กœ ๋ฐ์ดํ„ฐ ์ฝ๊ธฐ, ๊ณต๋ฐฑ ๋‹จ์œ„๋ฅผ ๋Š์–ด์ฃผ์ง€ ๋ชปํ•จ. ๋‹ค๋ฅธ ํƒ€์ž…์œผ๋กœ ์ž…๋ ฅ๋ฐ›์œผ๋ ค๋ฉด ํ˜•๋ณ€ํ™˜์ด ํ•„์š” read() : ํ•œ ๊ธ€์ž๋งŒ ์ฝ์–ด ์ •์ˆ˜..
spring security๋ฅผ ๊ณต๋ถ€ํ•˜๊ณ ์ž, spring boot file์„ ์ƒ์„ฑํ•˜์˜€๋Š”๋ฐ build ์‹œ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•˜์˜€๋‹ค. ํ”„๋กœ์ ํŠธ ๋ฒ„์ „์ด 17์ด์–ด์„œ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•˜์˜€๊ณ , 11๋กœ downgrade๋ฅผ ํ•ด์ฃผ์–ด์„œ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜์˜€๋‹ค. # build.gradle file ์ˆ˜์ • group = 'com.example' version = '0.0.1-SNAPSHOT' sourceCompatibility = '17' ----------------------------------------------- group = 'com.example' version = '0.0.1-SNAPSHOT' sourceCompatibility = '11' #๋ณ€๊ฒฝ
import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); StringBuilder sb = new StringBuilder(); // String ๊ณผ ๋ฌธ์ž์—ด์„ ๋”ํ•  ๋•Œ ์ƒˆ๋กœ์šด ๊ฐ์ฒด๋ฅผ ์ƒ์„ฑํ•˜๋Š” ๊ฒƒ์ด ์•„๋‹Œ, ๊ธฐ์กด์˜ ๋ฐ์ดํ„ฐ๋ฅผ ๋”ํ•˜๋Š” ๋ฐฉ์‹ // ์†๋„๊ฐ€ ๋น ๋ฅด๋ฉฐ, ์ƒ๋Œ€์ ์œผ๋กœ ๋ถ€ํ•˜๊ฐ€ ์ ์œผ๋ฏ€๋กœ ๊ธด ๋ฌธ์ž์—ด์„ ๋”ํ•˜๋Š” ์ƒํ™ฉ์—์„œ ์‚ฌ์šฉ // StringBuffer: ๊ณตํ†ต ๋ฉ”์†Œ๋“œ ๋™๊ธฐํ™” ๋ฉ€ํ‹ฐ ์Šค๋ ˆ๋“œ ํ™˜๊ฒฝ์—์„œ๋งŒ // StringBuilder: ๊ทธ์™ธ์˜ ๊ธฐ๋Šฅ์€ ..
import java.util.Scanner; public class _2675 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int t = scanner.nextInt(); int[] r = new int[t]; String[] s = new String[t]; if(t>=1 && t
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int t = scanner.nextInt(); int[] output = new int[t]; for(int i = 0; i 0&&a0&&b
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int input = 0; int[] a = new int [10]; for(int i = 0; i
Window - Show View - Package Explorer [์ถœ์ฒ˜] https://asiatica-aramid.tistory.com/11
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); scanner.close(); for(int i = 1; i0 ; j--) { if(i
public class Main { public static void main(String[] args) { Date date = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); String sdfD = sdf.format(date); System.out.println(sdfD); } } Date์— ๊ด€ํ•œ ์ฝ”๋“œ๋ฅผ ์ฃผ๋กœ ์‚ฌ์šฉํ•˜์ง€ ์•Š๊ธฐ ๋•Œ๋ฌธ์— ๋‹ค์‹œ ๋ณต์Šตํ•˜๊ณ ์ž ๋ธ”๋กœ๊ทธ์— ๊ธ€์„ ๋‚จ๊ธด๋‹ค.
public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); long n = scanner.nextLong(); long j = scanner.nextLong(); System.out.println(Math.abs(j-n)); scanner.close(); } } ์ ˆ๋Œ“๊ฐ’์— ๋Œ€ํ•œ ๋ฌธ์ œ๋ฅผ ํ’€์—ˆ๋‹ค. int ๋ฐ์ดํ„ฐ ํƒ€์ž…์„ ์‚ฌ์šฉํ•ด์„œ ๋ฌธ์ œ๋ฅผ ํ’€์—ˆ๋Š”๋ฐ, ์ ˆ๋Œ“๊ฐ’์œผ๋กœ ๊ฑฐ๋ฆฌ๋ฅผ ๊ตฌํ•˜๋Š” ๋ฌธ์ œ์ด๋‹ค๋ณด๋‹ˆ N, M์„ ํ•ฉ์นœ ๊ฑฐ๋ฆฌ๋Š” int ์ด์ƒ์˜ ๋ฐ์ดํ„ฐ ํƒ€์ž…์ด ํ•„์š”ํ•˜๋‹ค. (long) import java.util.Scanner; public class Main { public static void main(Stri..
chaerlo127
๐Ÿ€ chaeng_ni.develog