Java & Spring/Java

    [Tomcat] 8080 ํฌํŠธ ๊ฐ•์ œ ์ข…๋ฃŒ

    Tomcat ํฌํŠธ 8080 ์ถฉ๋Œ ํ•ด๊ฒฐ๋ฐฉ๋ฒ• (tistory.com) Tomcat ํฌํŠธ 8080 ์ถฉ๋Œ ํ•ด๊ฒฐ๋ฐฉ๋ฒ• ์ดํด๋ฆฝ์Šค์— ํ†ฐ์บฃ์„ ์—ฐ๊ฒฐํ•˜์—ฌ ์ž‘์—…์„ ํ•˜๋‹ค๋ณด๋ฉด ํ•œ๋ฒˆ์”ฉ ์žฌ๊ตฌ๋™์ค‘์— 8080ํฌํŠธ๊ฐ€ ์ถฉ๋Œ์ด ์ผ์–ด๋‚˜ ์‹คํ–‰์ด ๋˜์ง€ ์•Š๋Š” ๊ฒฝ์šฐ๊ฐ€ ์žˆ๋‹ค. ์ด๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•œ ๋ฐฉ๋ฒ•์€ ์ปดํ“จํ„ฐ ์žฌ๋ถ€ํŒ…์„ ํ•˜๊ฑฐ๋‚˜ ์ดํด๋ฆฝ์Šค์— ์—ฐ๋™ sentinel32.tistory.com 1. netstat -a -o ๋ฅผ ์ž…๋ ฅํ•˜๋ฉด ํ˜„์žฌ ์‚ฌ์šฉ์ค‘์ธ ํฌํŠธ ๋ชฉ๋ก์ด ๋‚˜์˜จ๋‹ค. 2. 8080ํฌํŠธ๋ฒˆํ˜ธ๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ํ”„๋กœ์„ธ์Šค์˜ PID ์ˆซ์ž๋ฅผ ๊ธฐ์–ตํ•ด๋‘” ๋’ค 3. taskkill /f /pid 'PID๋ฒˆํ˜ธ'๋ฅผ ์ž…๋ ฅํ•˜์—ฌ 8080ํฌํŠธ๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ํ”„๋กœ์„ธ์Šค๋ฅผ ๊ฐ•์ œ ์ข…๋ฃŒ์‹œํ‚จ๋‹ค.

    [JAVA] ์ž๋ฐ”์˜ Array : Compare, fill, sort

    1. ํ–ฅ์ƒ๋œ loop public class App { public static void main(String[] args) throws Exception { //[1] Input : n๋ช…์˜ ๊ตญ์–ด ์ ์ˆ˜ int[] scores = {100, 75, 3 ,5 ,3, 22, 34}; int sum = 0; //[2] Process for (int i = 0; i < scores.length; i++) { sum += scores[i]; } //[3] Output System.out.println(sum); int sum1 = 0; for (int x : scores) { sum1 += x; } System.out.println(sum1); } } int[] scores = {100, 75, 3 ,5 ,3, 2..

    [Java] ์ธํ„ฐํŽ˜์ด์Šค

    [Java] ์ธํ„ฐํŽ˜์ด์Šค

    ํด๋ž˜์Šค ๋Œ€์‹  ์ธํ„ฐํŽ˜์ด์Šค ํ‚ค์›Œ๋“œ๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค. ์ธํ„ฐํŽ˜์ด์Šค์—์„œ๋Š” ์„ ์–ธ์„ ์ œ๊ณตํ•˜๋Š” ๊ฒƒ์ด์ง€, ์ •์˜๋ฅผ ๋‚ด๋ฆฌ๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๋‹ค. public interface GamingConsole { public void up(); public void down(); public void left(); public void right(); } ํ•ด๋‹น ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ๊ตฌํ˜„ํ•œ ํด๋ž˜์Šค๋ฅผ ํ•˜๋‚˜ ๋งŒ๋“ค์–ด์ค€๋‹ค. public class MarioGame implements GamingConsole { @Override public void up() { System.out.println("Jump!"); } @Override public void down() { System.out.println("Goes into a hole!"); } @Overrid..

    [Java] ์ž๋ฐ” List ์ธํ„ฐํŽ˜์ด์Šค ๊ตฌํ˜„ ArrayList vs LinkedList

    [Java] ์ž๋ฐ” List ์ธํ„ฐํŽ˜์ด์Šค ๊ตฌํ˜„ ArrayList vs LinkedList

    ์ „ ํฌ์ŠคํŒ…์— ์ด์–ด์„œ ์ž‘์„ฑํ•ฉ๋‹ˆ๋‹ค. import java.util.ArrayList; import java.util.LinkedList; import java.util.List; import java.util.Vector; public class Hello { public static void main(String[] args) { List words = List.of("Jisoo", "Lisa", "Jenny", "Rose"); List wordsArrayList = new ArrayList(words); wordsArrayList.add("GD"); System.out.println(wordsArrayList); // [Jisoo, Lisa, Jenny, Rose, GD] System.out.printl..

    [Java] ์ž๋ฐ” List.of()๋กœ ๋งŒ๋“  ๋ถˆ๋ณ€ ๋ฆฌ์ŠคํŠธ๋ฅผ ๊ฐ€๋ณ€ ๋ฆฌ์ŠคํŠธ๋กœ ๋ฐ”๊พธ๊ธฐ

    [Java] ์ž๋ฐ” List.of()๋กœ ๋งŒ๋“  ๋ถˆ๋ณ€ ๋ฆฌ์ŠคํŠธ๋ฅผ ๊ฐ€๋ณ€ ๋ฆฌ์ŠคํŠธ๋กœ ๋ฐ”๊พธ๊ธฐ

    ์ด๋ฒˆ ํฌ์ŠคํŒ…์—์„œ๋Š” List.of()๋กœ ๋งŒ๋“  ๋ถˆ๋ณ€ ๋ฆฌ์ŠคํŠธ(๋‚ด๋ถ€ ์ •๋ณด ๋ฐ”๊ฟ€ ์ˆ˜ ์—†์Œ)๋ฅผ ํ•™์Šตํ•ด๋ณด๊ณ , ์ด๋ฅผ ํ†ตํ•ด ๊ฐ€๋ณ€ ๋ฆฌ์ŠคํŠธ(๋‚ด๋ถ€์ •๋ณด ๋ฐ”๊ฟ€ ์ˆ˜ ์žˆ์Œ)๋ฅผ ๋งŒ๋“œ๋Š” ๋ฐฉ๋ฒ•๊นŒ์ง€ ์•Œ์•„๋ณธ๋‹ค. Collections - List - Set - Queue - Map ์ž๋ฐ”๋ฅผ ๊ณต๋ถ€ํ•  ๋•Œ ํƒœ๋„ ์ตœ์‹  ๋ฒ„์ „ + ํ‚ค์›Œ๋“œ ๊ตฌ๊ธ€๋งํ•˜์—ฌ ์ œ์ผ ์œ„์— ๋‚˜์˜ค๋Š” ์˜ค๋ผํด ํ—ฌํผ ์„ผํ„ฐ ๋ฌธ์„œ๋ฅผ ์—ด์‹ฌํžˆ ์ฝ์„ ๊ฒƒ. List ์ •์˜ https://docs.oracle.com/javase/9/docs/api/java/util/List.html ์ •๋ ฌ๋œ ์ปฌ๋ ‰์…˜( sequence๋ผ๊ณ ๋„ ํ•จ ). ์ด ์ธํ„ฐํŽ˜์ด์Šค์˜ ์‚ฌ์šฉ์ž๋Š” ๋ชฉ๋ก์—์„œ ๊ฐ ์š”์†Œ๊ฐ€ ์‚ฝ์ž…๋˜๋Š” ์œ„์น˜๋ฅผ ์ •ํ™•ํ•˜๊ฒŒ ์ œ์–ดํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์‚ฌ์šฉ์ž๋Š” ์ •์ˆ˜ ์ธ๋ฑ์Šค(๋ชฉ๋ก์˜ ์œ„์น˜)๋กœ ์š”์†Œ์— ์•ก์„ธ์Šคํ•˜๊ณ  ๋ชฉ๋ก์˜ ์š”์†Œ๋ฅผ ๊ฒ€์ƒ‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค...

    [Java] ๊ฐ์ฒด๋Š” ์ƒ์†์˜ ์ตœ์ƒ์œ„ ์ˆœ์œ„

    [Java] ๊ฐ์ฒด๋Š” ์ƒ์†์˜ ์ตœ์ƒ์œ„ ์ˆœ์œ„

    ์Šˆํผ ํด๋ž˜์Šค People๊ณผ ์„œ๋ธŒ ํด๋ž˜์Šค Student (1) ์Šˆํผ ํด๋ž˜์Šค People public class People { private String name; private String phoneNumber; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPhoneNumber() { return phoneNumber; } public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } } (2) ์„œ๋ธŒ ํด๋ž˜์Šค Student public class Student ext..

    [Java IDE] eclipse IDE ์Šคํƒ€์ผ ๋ณ€๊ฒฝํ•˜๊ธฐ

    [Eclipse] ์ดํด๋ฆฝ์Šค ์ธํ„ฐํŽ˜์ด์Šค ์„ธํŒ…ํ•˜๊ธฐ (Black ํ…Œ๋งˆ, Marketplace, ๊ฐœ๋ฐœ์šฉ ํฐํŠธ ์ถ”์ฒœ) (tistory.com) [Eclipse] ์ดํด๋ฆฝ์Šค ์ธํ„ฐํŽ˜์ด์Šค ์„ธํŒ…ํ•˜๊ธฐ (Black ํ…Œ๋งˆ, Marketplace, ๊ฐœ๋ฐœ์šฉ ํฐํŠธ ์ถ”์ฒœ) ์ดํด๋ฆฝ์Šค ํ…Œ๋งˆ ๋ณ€๊ฒฝ 1. [Windows] > [Preference] 2. [General] > [Appearance] > Theme ์„ ํƒ (default: Light) 3. Theme : 'Dark' ๋ณ€๊ฒฝ ๋ชจ์Šต ๋‹ค๋งŒ, ์ดํด๋ฆฝ์Šค ๊ธฐ๋ณธ Dark ํ…Œ๋งˆ๋Š” ๋ฐฐ๊ฒฝ์ด ํšŒ์ƒ‰ํ†ค์—, ์—๋””ํ„ฐ ํฐํŠธ.. bada744.tistory.com

    [์ž๋ฐ”์˜ ์ •์„] Hello Java & Eclipse ๋‹จ์ถ•ํ‚ค

    [์ž๋ฐ”์˜ ์ •์„] Hello Java & Eclipse ๋‹จ์ถ•ํ‚ค

    ์ƒˆ๋กœ์šด ํด๋ž˜์Šค๋ฅผ ๋งŒ๋“œ๋ ค๋ฉด CTRL + n ํด๋ž˜์Šค๋ช… ์ฐพ๊ธฐ ctrl + SHIFT + R main ์„ ์น˜๊ณ  CTRL + SPACE : ๋ฉ”์ธ ๋ฉ”์„œ๋“œ ์ž๋™ ์ƒ์„ฑ sysout์„ ์น˜๊ณ  CTRL + SPACE ์„ ๋ˆ„๋ฅด๋ฉด {System.out.printIn()}์œผ๋กœ ์ž๋™ ํ™•์žฅ https://youtu.be/E8fTLFuc7X4 CMD์ฐฝ์—์„œ C:\jdk11\work>javac Helllo.java C:\jdk11\work>java Hello Hello, World https://youtu.be/emllFzqD1-0 ์ดํด๋ฆฝ์Šค๋Š” ๊ธฐ๋ณธ์ €๊ทธ์˜ฌ ์†Œ์Šค ํŒŒ์ผ๊ณผ ํด๋ž˜์Šค ํŒŒ์ผ์„ ๋ณ„๋„์˜ ํด๋”์— ๋‹ด์—์„œ ๊ด€๋ฆฌํ•œ๋‹ค. ํŠนํžˆ .์œผ๋กœ ์‹œ์ž‘ํ•˜๋Š” ํŒŒ์ผ๋“ค์€ ์ดํด๋ฆฝ์Šค๊ฐ€ ์ž๋™์œผ๋กœ ์ƒ์„ฑํ•ด์„œ ๋งŒ๋“  ๊ด€๋ จ ํŒŒ์ผ๋“ค์ด๋ฏ€๋กœ ๊ฑด๋“ค์ง€ ์•Š๋Š” ๊ฒƒ์ด ์ข‹๋‹ค.

    [์ž๋ฐ”์˜ ์ •์„] Java๋ž€

    [์ž๋ฐ”์˜ ์ •์„] Java๋ž€

    https://youtu.be/oJlCC1DutbA https://youtu.be/J1xJhrr63VY * ๋‚จ๊ถ์„ฑ๋‹˜์˜ ์ž๋ฐ”์˜ ์ •์„ ์œ ํŠœ๋ธŒ ๋ฌด๋ฃŒ๊ฐ•์ขŒ๋ฅผ ๋ณด๊ณ  ํ•™์Šตํ•œ ํฌ์ŠคํŒ…์ž…๋‹ˆ๋‹ค. ์™œ ์ž๋ฐ”๋ฅผ ๋ฐฐ์›Œ์•ผ ํ• ๊นŒ? ์ž๋ฐ”(Java)๋Š” ์›น(web)๊ณผ ๋ชจ๋ฐ”์ผ(์•ˆ๋“œ๋กœ์ด๋“œ)์„ ๋น„๋กฏํ•œ ๋‹ค์–‘ํ•œ ๋ถ„์•ผ์—์„œ ์‚ฌ์šฉ๋˜๋Š” ๊ฐ€์žฅ ์ธ๊ธฐ ์žˆ๋Š” ์–ธ์–ด๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์ทจ์—…์‹œ์ž๋ฐ”๋ฅผ ํ†ตํ•ด ์ปดํ“จํ„ฐ ๊ณผํ•™ ๊ด€๋ จ ์ง€์‹๊ณผ ์•Œ๊ณ ๋ฆฌ์ฆ˜์„ ๋ฐฐ์šฐ๋Š” ๋ฐ ์žˆ์–ด์„œ ๋‹ค๋ฅธ ์–ธ์–ด๋ณด๋‹ค ์ž๋ฐ”๊ฐ€ ์œ ๋ฆฌ ์ž๋ฐ”๋ž€ ๋‹จ์ˆœํžˆ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด๊ฐ€ ์•„๋‹ˆ๋ผ ์‹คํ–‰ํ™˜๊ฒฝ(JRE) + ๊ฐœ๋ฐœ๋„๊ตฌ(JDK) + ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ(API)๋ฅผ ์ œ๊ณตํ•œ๋‹ค. ์ž๋ฐ”์—์„œ ์ œ๊ณตํ•˜๋Š” ํ’๋ถ€ํ•œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ์‰ฝ๊ณ  ๋น ๋ฅด๊ฒŒ ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜ ๊ฐœ๋ฐœ ๊ฐ€๋Šฅํ•˜๋‹ค. ๊ฐ์ฒด์ง€ํ–ฅ์ด๋ฉด์„œ ํ•จ์ˆ˜ํ˜•(์ถ”๊ฐ€๋จ) ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด์ด๋‹ค. ์ž๋ฐ”8์œผ๋กœ ๋ฐฐ์šฐ๋Š” ๊ฒƒ์ด ์•ˆ์ •์„ฑ์ด ๋†’๋‹ค. ์ž..

    [์ž๋ฐ”] ์ดˆ๊ฐ„๋‹จ ์„ฑ์ ํ•ฉ์‚ฐ ํ”„๋กœ๊ทธ๋žจ

    class Grade{ int enggrade; //์˜์–ด์„ฑ์ ๋ณ€์ˆ˜ int mathgrade;//์ˆ˜ํ•™์„ฑ์ ๋ณ€์ˆ˜ void outputgrade() { System.out.println(enggrade+mathgrade); } } public class HelloWorld { public static void main(String[] args) { Grade gradeA=new Grade(); //2๋ช…์˜ ์„ฑ์ ์„ ํ‘œํ˜„ํ•  ๊ฐ์ฒด ์ƒ์„ฑ Grade gradeB=new Grade(); gradeA.enggrade = 90;//์ ์ˆ˜์ž…๋ ฅ gradeA.mathgrade = 75; gradeB.enggrade =80; gradeB.mathgrade=60; gradeA.outputgrade(); gradeB.outputgrade()..