묻고 답해요
158만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
해결됨[Unity] 함께 만들어가는 방치형 게임 개발
안녕하세요 소스코드를 다운 받고 싶은데요.. 언제 제공 받을 수 있을까요?
안녕하세요. 게임 구현 중에서 일부분적으로 이해가 안되는 부분이 있어서 강의 학습을 시작하였습니다.다 따라쳐서 하는 기초 목적으로 수강하지 않아서, 일단 유니티 에디터에서 플레이는 되게하고 응용해보고 싶은데요. 강의 종료 후 제공된다고 글이 있는 것 같은데요.. 지금 커리큘럼이 출시?로 보이는데 다 끝난건지, 소스 코드가 언제 제공되는지 궁금합니다 ...
-
미해결누구나 할 수 있는 NFT 만들기
npm install 에러코드 해결법
npm error code 1npm error path C:\Users\sonji\Desktop\hashlips_art_engine-main\node_modules\canvasnpm error command failednpm error command C:\WINDOWS\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-buildnpm error Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\sonji\Desktop\hashlips_art_engine-main\node_modules\canvas\build\Release\canvas.node --module_name=canvas --module_path=C:\Users\sonji\Desktop\hashlips_art_engine-main\node_modules\canvas\build\Release --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1) npm error node-pre-gyp info it worked if it ends with oknpm error node-pre-gyp info using node-pre-gyp@1.0.6npm error node-pre-gyp info using node@18.20.5 | win32 | x64npm error node-pre-gyp info check checked for "C:\Users\sonji\Desktop\hashlips_art_engine-main\node_modules\canvas\build\Release\canvas.node" (not found) npm error gyp ERR! find Python **********************************************************npm error gyp ERR! find Pythonnpm error gyp ERR! configure errornpm error gyp ERR! stack Error: Could not find any Python installation to usenpm error gyp ERR! stack at PythonFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:306:11)npm error gyp ERR! stack at PythonFinder.findPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:164:17)npm error gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:95:5)npm error gyp ERR! stack at async configure (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:27:18)npm error gyp ERR! stack at async run (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js:81:18)npm error gyp ERR! System Windows_NT 10.0.22631npm error gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\Users\\sonji\\Desktop\\hashlips_art_engine-main\\node_modules\\canvas\\build\\Release\\canvas.node" "--module_name=canvas" "--module_path=C:\\Users\\sonji\\Desktop\\hashlips_art_engine-main\\node_modules\\canvas\\build\\Release" "--napi_version=9" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v108"npm error gyp ERR! cwd C:\Users\sonji\Desktop\hashlips_art_engine-main\node_modules\canvasnpm error gyp ERR! node -v v18.20.5npm error gyp ERR! node-gyp -v v10.1.0npm error gyp ERR! not oknpm error node-pre-gyp ERR! build errornpm error node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\sonji\Desktop\hashlips_art_engine-main\node_modules\canvas\build\Release\canvas.node --module_name=canvas --module_path=C:\Users\sonji\Desktop\hashlips_art_engine-main\node_modules\canvas\build\Release --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)npm error node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\sonji\Desktop\hashlips_art_engine-main\node_modules\@mapbox\node-pre-gyp\lib\util\compile.js:89:23)npm error node-pre-gyp ERR! stack at ChildProcess.emit (node:events:517:28)npm error node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1098:16)npm error node-pre-gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:303:5)npm error node-pre-gyp ERR! System Windows_NT 10.0.22631npm error node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\sonji\\Desktop\\hashlips_art_engine-main\\node_modules\\@mapbox\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"npm error node-pre-gyp ERR! cwd C:\Users\sonji\Desktop\hashlips_art_engine-main\node_modules\canvasnpm error node-pre-gyp ERR! node -v v18.20.5npm error node-pre-gyp ERR! node-pre-gyp -v v1.0.6npm error node-pre-gyp ERR! not oknpm error A complete log of this run can be found in: C:\Users\sonji\AppData\Local\npm-cache\_logs\2024-11-26T14_30_27_324Z-debug-0.log
-
미해결Java/Spring 테스트를 추가하고 싶은 개발자들의 오답노트
영속성 객체 구분으로 인한 JPA와 Querydsl의 Projection 사용
지금은 간단한 예제라 엔티티에서 JpaRepository를 사용하여 데이터를 가공해서 가져온 후 도메인 객체로 매핑시켜 controller에 넘겨 controller에서 response 객체로 변환시켰습니다.만약 Projection을 사용하는 경우Projection에서 바로 controller 패키지 안의 response 패키지 객체로 접근하는 것은 어떻게 생각하시나요?
-
해결됨쉽게 설명하는 AWS 기초 강의
다음 강의 공개 일정
800명이 넘는 AWS 강의실 오픈채팅방에 오시면 더 좋은 답변을 실시간으로 받아보실 수 있습니다.질문내용은 상세하고 자세하게 부탁드립니다.예시 : "Amazon EC2의 t2.micro 타입으로 Amazon Linux 2023타입으로 퍼브릭 서브넷에 프로비전 했습니다. 키페어와 같이 프로비전해서 SSH로 접속하고 싶은데 접속 요청시 Timeout이 발생합니다. 어디를 확인하면 될까요?"안녕하세요. 좋은 강의 감사드립니다.혹시 섹션 15부터는 언제 공개 예정일지 알 수 있을까요?
-
미해결Flutter로 SNS 앱 만들기
섹션15페이징기능_3좋아요 목록 화면에 페이징 적용
이페이지에서는 강의 없던 코드가 강의코드가 있고,갑자기 나오고, 이페이지에서는 정리가 안돼요. 또 실행도 잘안돼요.프로필화면에서도 6개 게시물인데 3개만가져오고, 좋아요 화면은 실행이 안돼고... 이페이지는다시 영상만들어야 할것 같아요
-
미해결[백문이불여일타] 데이터 분석을 위한 고급 SQL
a.id = 1과 b.id=1이 없어도 되는 이유
p1. id | p1.email | p2.id | p2.email1 | john@example.com | 1 | john@example.com X 1 | john@example.com | 3 | john@example.com O2 | bob@example.com | 2 | bob@example.com O3 | john@example.com | 1 | john@example.com X3 | john@example.com | 3 | john@example.com X여기서 p1.id=1과 p2.id=1인 경우에도 지워줘야 한다 하셨는데 그 이유가 혹시 p1.id=1과 p2.id=3으로 id가 1인 경우가 지워지지 않고 있기 때문에 없어도 된다 하신 걸까요?
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
스탠다드 스케일
안녕하세요,기출 7회 작업형 1 문제1 질문드립니다.스탠다드스케일을 할때, 저는 cond = df['id_assessment'] == 12 a = df[cond]['score'] std = a.std() mean = a.mean() df['standard'] = (df['score']-mean) / std b = df['standard'].max() round(b,3)이렇게 답을 구했더니, 사이킷런 스탠다드 스케일로 구한값과 약간의 차이가 있더라구요,만약 작업형1 시험에서 MinMaxScaler 또는 스탠다는 스케일을 하라고 문제가 나왔을 때, 사이킷런 으로 푸는 것이 정답일까요? 아니면 실제 수식을 적용시켜서 푸는 것이 정답일까요?
-
미해결[리뉴얼] 파이썬입문과 크롤링기초 부트캠프 [파이썬, 웹, 데이터 이해 기본까지] (업데이트)
연습문제1번 추가질문
연습문제 1번 Blog와 about 메뉴리스트 출력하기 중select_one을 이용해 하위 태그를 이용했는데blog 라는 결과값이 중복되서 나오드라구요하위태그의 클래스 이름이 같기 때문에 첫 번째 blog만 나오게 되는건가요? 저는 상위 태그가 다르기 때문에 별도로 blog와 about 나올거라 생각을 한것 같습니다.설명 부탁드리겠습니다.
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
작업형2 데이터 전처리
안녕하세요, 강사님 !작업형2에서 모델링 하기 전 전처리 하실 때어떤 때는 수치형만 전처리하고, 어떤 때는 범주형만 전처리를 하던데 혹시 어떤 기준에 따라 정해지는 걸까요...?시험 때는 범주형과 수치형 다 전처리를 해주는 게 좋을까요..?
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
기출 8 작업형2
학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요!질문과 관련된 영상 위치를 알려주면 더 빠르게 답변할 수 있어요먼저 유사한 질문이 있었는지 검색해보세요customerID 가 데이터 갯수만큼 있는지, 반복성이 있는지에 따라 삭제, 라벨인코딩을 한다고 하셨는데, 반복성이 있는지는 어떤걸 보고 판단하는건가요?
-
미해결[리뉴얼] 파이썬입문과 크롤링기초 부트캠프 [파이썬, 웹, 데이터 이해 기본까지] (업데이트)
연습문제1번
연습문제 1번 Blog와 about 메뉴리스트 출력하기 중문자열로 변환하는 함수에서변수.string 과 변수.get_text() 결과값이 다르게 나오는데 차이점 설명 부탁드립니다.
-
해결됨한 입 크기로 잘라 먹는 리액트(React.js) : 기초부터 실전까지
jsx와 js를 구분해서 사용하는 이유
섹션 13강의 중 "폰트, 이미지, 레이아웃 설정하기" 강의를 보면,이미지 가져오는 것을 컴포넌트화 하는 부분이 나옵니다.util폴더 아래에 get-emotion- image라는 파일을 만드는 부분인데,해당 파일을 jsx가 아닌 js로 만드는 이유가 궁금합니다.제가 해당 파일을 jsx로 해도 정상 작동이 되던데, 리액트에서 js로 하신 이유가 뭘까요?문의드립니다.
-
미해결[유니티 레벨 업!] 모듈식으로 개발하는 퀘스트&업적 시스템
Task 에서 Object 타입 사용
안녕하세요! 강의 잘 듣고 있습니다. Object 타입을 사용하면 박싱 - 언박싱이 발생할 것 같은데 큰 문제는 없는 건가요? 박싱과 언박싱을 지양하라는 글을 많이 봐서 그런지 거부감이 큰 것 같습니다. 성능에 안 좋다는데 사용해도 될지 의문입니다.
-
미해결Vue.js 완벽 가이드 - 실습과 리팩토링으로 배우는 실전 개념
깃허브 권한 요청 드립니다
인프런 아이디 : tm.jung인프런 이메일 : tm.jung@brainz.co.kr깃헙 아이디 : kcw2371@gmail.com깃헙 Username : kcw2297
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
7회 2유형 문제 에러 문의
7회 2유형에서 아래와 같이 코딩을 했는데 에러가 발생합니다. 에러기 왜 발생하는지 모르겠습니다.에러는 train_test_split 함수에서 "TypeError: isinstance() arg 2 must be a type, a tuple of types, or a union" 라고 나옵니다 import pandas as pd train = pd.read_csv('churn_train.csv') test = pd.read_csv('churn_test.csv') y=train.pop('TotalCharges') # print(test.head()) # print(train.shape, test.shape) # print(y.describe()) total = pd.concat([train, test],axis=0) # print (total.shape) total = total.drop('customerID',axis=1) # print (total.shape) total=pd.get_dummies(total) # print (total.shape) # print(total.head()) train = total[0:4116] test = total[4116:] # print(train.shape, test.shape) from sklearn.model_selection import train_test_split X_train, X_val, y_train, y_val = train_test_split(train, y, test_size=0.2, random_state=2024) # print(X_train.head()) # print(X_train.shape, X_val.shape, y_train.shape, y_val.shape) from sklearn.ensemble import RandomForestRegressor rf=RandomForestRegressor() rf.fit(X_train, y_train) pred1=rf.predict(X_val) from sklearn.metrics import mean_squared_error print((mean_squared_error(pred1, y_val))**(1/2)) pred= rf.predict(test) result=pd.DataFrame=({ 'pred':pred }) result.to_csv('result.csv', index=False)
-
해결됨고객의 친구가 되기 위한 'UX Writing'
강의자료 요청드립니다.
제가 메일을 잃어버려서요.. 로 혹시 강의자료를 부탁드려도 될까요? 부탁드립니다.
-
미해결[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
6회 기출 -> 1유형 -> 2번 이처럼 풀이해도 될까요?
import pandas as pd df = pd.read_csv('data6-1-2.csv') # print(df.head()) df['전교생'] = df['1학년'] + df['2학년'] + df['3학년'] + df['4학년'] + df['5학년'] + df['6학년'] df['교사당학생수'] = df['전교생'] // df['교사수'] print(df.sort_values('교사당학생수', ascending=False)) # 19 답은 당연히 동일하게 나오는데요! iloc, loc 사용 않고 별도 컬럼 추가해주면서 계산하는 방식도 또 하나의 풀이 과정으로 볼 수 있겠죠?살짝 하드코딩 느낌이 나서 여쭤봅니다
-
해결됨
리액트 & 스프링 부트 SSE 알람 기능 구현 CORS에러
헌재 상황은 NGINX로 HTTPS로 백엔드를 배포하고 있고 리액트는 로컬에서 작업 중인데 알람 기능을 구현할 때 OPTIONS가 CORS에러를 일으킵니다.```@Service @RequiredArgsConstructor @Log4j2 @Transactional public class NotificationService { // SSE 이벤트 타임아웃 시간 private static final Long DEFAULT_TIMEOUT = 24L * 60 * 60 * 1000; // SSE 연결 타임아웃 (1일) private final CustomNotificationRepository customNotificationRepository; private final MemberRepository memberRepository; private final CommunityRepository communityRepository; private final NotificationRepository notificationRepository; // 메시지 알림 public SseEmitter subscribe(String memberEmail, String lastEventId) throws Exception { // 회원 조회 MemberEntity findMember = memberRepository.findByMemberEmail(memberEmail); // 매 연결마다 고유 이벤트 ID 부여 String eventId = makeTimeIncludeId(findMember); log.info("eventId {} ", eventId); // SseEmitter 생성후 Map에 저장 SseEmitter sseEmitter = customNotificationRepository.save(eventId, new SseEmitter(DEFAULT_TIMEOUT)); // 사용자에게 모든 데이터가 전송되었다면 emitter 삭제 sseEmitter.onCompletion(() -> { log.info("onCompletion callback"); customNotificationRepository.deleteById(eventId); }); // Emitter의 유효 시간이 만료되면 emitter 삭제 // 유효 시간이 만료되었다는 것은 클라이언트와 서버가 연결된 시간동안 아무런 이벤트가 발생하지 않은 것을 의미한다. sseEmitter.onTimeout(() -> { log.info("onTimeout callback"); customNotificationRepository.deleteById(eventId); }); // 503 에러를 방지하기 위한 더미 이벤트 전송 sendToClient(eventId, sseEmitter, "알림 서버 연결 성공 [memberId = " + findMember.getMemberId() + "]"); // 클라이언트가 미수신한 Event 목록이 존재할 경우 전송하여 Event 유실을 예방 if (hasLostData(lastEventId)) { sendLostData(lastEventId, findMember.getMemberId(), sseEmitter); } return sseEmitter; } private static @NotNull String makeTimeIncludeId(MemberEntity findMember) { String eventId = findMember.getMemberId() + "_" + System.currentTimeMillis(); return eventId; } private void sendToClient(String eventId, SseEmitter sseEmitter, Object data) { try { sseEmitter.send(SseEmitter.event() .name("connect") .id(eventId) .data(data)); } catch (IOException e) { customNotificationRepository.deleteById(eventId); throw new RuntimeException("알림 서버 연결 오류"); } } private boolean hasLostData(String lastEventId) { return !lastEventId.isEmpty(); } private void sendLostData(String lastEventId, Long memberId, SseEmitter sseEmitter) { Map<String, Object> eventCaches = customNotificationRepository.findAllEventCacheStartWithByMemberId(memberId); eventCaches.entrySet().stream() .filter(entry -> lastEventId.compareTo(entry.getKey()) < 0) .forEach(entry -> sendToClient(entry.getKey(), sseEmitter, entry.getValue())); } ...이렇게 서비스를 구현하고@RestController @RequestMapping("/api/v1/notify") @RequiredArgsConstructor @Log4j2 public class NotificationController implements NotificationControllerDocs { private final NotificationService notificationService; // 메시지 알림 // SSE 통신을 위해서는 produces로 반환할 데이터 타입을 "text/event-stream"으로 해주어야 함 @GetMapping(value = "/subscribe", produces = MediaType.TEXT_EVENT_STREAM_VALUE) @PreAuthorize("hasRole('ROLE_USER') or hasRole('ROLE_ADMIN')") public SseEmitter subscribe(@AuthenticationPrincipal UserDetails userDetails, @RequestHeader(value = "last-event-id", required = false, defaultValue = "") final String lastEventId, HttpServletResponse response) { try { if (userDetails == null) { throw new IllegalArgumentException("인증 정보가 필요합니다."); } response.setHeader("Connection", "keep-alive"); response.setHeader("Cache-Control", "no-cache"); response.setHeader("X-Accel-Buffering", "no"); String email = userDetails.getUsername(); SseEmitter responseEmitter = notificationService.subscribe(email, lastEventId); log.info("Subscribed to email: " + email); log.info("response: " + responseEmitter); return responseEmitter; } catch (Exception e) { throw new RuntimeException(e); } } ...NGINX 설정server { listen 443 ssl; server_name meettify.store; ssl_certificate /etc/letsencrypt/live/meettify.store/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/meettify.store/privkey.pem; include /etc/letsencrypt/options-ssl-nginx.conf; ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # SSE용 헤더 설정 location /api/v1/notify/subscribe { # OPTIONS preflight 요청을 처리하도록 설정 if ($request_method = 'OPTIONS') { add_header 'Access-Control-Allow-Origin' 'http://localhost:5173' always; add_header 'Access-Control-Allow-Credentials' 'true' always; add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always; add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type' always; add_header 'Access-Control-Max-Age' 3600 always; return 204; } proxy_pass https://meettify.store; # Spring Boot 서버로 요청 전달 proxy_http_version 1.1; proxy_set_header Connection ''; # SSE 연결 유지 proxy_set_header Host $host; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection ''; proxy_buffering off; proxy_cache off; chunked_transfer_encoding off; # SSE 연결 타임아웃 방지 proxy_set_header Cache-Control no-cache; proxy_read_timeout 86400s; keepalive_timeout 86400s; # 필요에 따라 시간 조정 add_header Access-Control-Allow-Origin "http://localhost:5173"; add_header Access-Control-Allow-Credentials "true"; } # 기본 프록시 설정 (백엔드 애플리케이션) location / { proxy_pass http://ubuntu-api-1:8080; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Connection ''; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection ''; proxy_buffering off; proxy_cache off; chunked_transfer_encoding off; } 이렇게 엔진엑스 설정까지 한다음@Configuration public class WebMvcConfig implements WebMvcConfigurer { @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**") .allowedOrigins("http://localhost:5173") .allowedHeaders("Authorization", "Content-Type") .allowCredentials(true) .exposedHeaders("Cache-Control", "Content-Type", "X-Accel-Buffering") .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS"); } } 이렇게 설정했는데 계속 CORS에러가 발생합니다.해당 문제가 지속적으로 반복중입니다. ㅠㅠ
-
미해결
인프라,DevOps, 클라우드 직군 북스터디
스터디 주제 :인프라,DevOps, 클라우드 직군 북스터디스터디 목표 : 인프라,DevOps, 클라우드 직군 관련 북스터디를 합니다. (EX: 쿠버네티스, 도커, 테라폼 등)예상 스터디 일정(횟수) : 월요일 PM 9~10시 현재 테라폼 쿡북을 진행할 예정입니다. 책이 끝나면 조율을 한 후, 다른 책을 정합니다. 북스터디의 경우 챕터를 나눠 깃허브, 블로그에 매주 정리 후 디스코드 혹은 구글 MEET에서 전원 발표 및 기술적인 토의를 합니다. 매 책이 끝나면 전체 토의가 있습니다. 다른 진행 의견이 있으면 모집 후 조율하겠습니다.빠진 인원이 있더라도 3명 이상이 되면 무조건 진행합니다. 모두의 시간은 소중하니 되도록 빠지지 말아주세요. 빠지더라도 미리 하루 전이나 당일 이른 오후까지는 꼭 말씀주세요. 예상 모집인원 : 6명 스터디 관련 주의사항 : 1만원의 보증금이 있습니다. 빠진 횟수 당 2천원을 벌금으로 차감합니다. 보증금은 1권의 책을 완료할 때 돌려받습니다. 새로운 책을 진행할 때마다 보증금을 겁니다. 스터디에 지원할 수 있는 방법을 남겨주세요. (이메일, 카카오 오픈채팅방, 구글폼 등.) : 오픈 카톡으로 와주세요. https://open.kakao.com/o/suTXRYMg
-
해결됨기초 탄탄! 독하게 시작하는 Java - Part 2 : OOP와 JVM
추상 클래스와 인터페이스에 대해서 궁금한 것이 있습니다.
안녕하세요 ㅎㅎ좋은 강의 제공해주셔서 감사합니다. 추상 클래스와 인터페이스 사용 시점에 대해 궁금한 것이 있습니다. 제가 처음에 생각한 내용은추상 클래스 : 부모 클래스와 자식 클래스가 공통으로 제공하는 내용(메서드)도 존재하지만, 자식클래스 별로 다른 내용을 제공할 때는 abstract 메서드를 사용하여 구현을 강제시킨다.인터페이스 : 부모와 자식 간에 공통으로 가지는 내용(메서드 내용이 동일한)이 없으므로, 상속받는 클래스가 반드시 메서드를 구현한다. 그런데 JAVA8부터 인터페이스에 default 메서드가 추가되었더군요.인터페이스에 default 메서드를 선언하면, 인터페이스를 상속받는 클래스에서 구현을 하지 않고도 사용할 수 있더라구요.interface Shape { final int SIZE = 5; void render(); default int getSize() { return SIZE; } } class Rectangle implements Shape { @Override public void render() { StringBuilder buffer = new StringBuilder(); for (int i = 0; i < SIZE; i++) { for (int j = 0; j < SIZE; j++) { buffer.append("*\t"); } buffer.append("\n"); } System.out.println(buffer); } }public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int input = sc.nextInt(); Shape shape; if (input == 0) { shape = new Rectangle(); } else { shape = new Triangle(); } shape.render(); System.out.println(shape.getSize()); } } 그렇다면 default 메서드가 추상 클래스의 일반 메서드(추상 클래스가 아닌)와 동일하게 작동하게 되는데public abstract class Shape { public static final int SIZE = 5; public abstract void render(); public int getSize() { return SIZE; } }추상 클래스와 인터페이스를 사용하는 시기(?)를 어떻게 구별해야할까요? 구글링을 해보니 인터페이스에 default 메서드가 추가된 이유가 추후에 인터페이스에 새로운 메서드를 추가했을 때, 해당 인터페이스를 상속하고 있는 클래스에서 오류가 발생하지 않기 위해서라고 하는데그 오픈소스가 엄청 유명해져서 전 세계 사람들이 다 사용하고 있는데, 인터페이스에 새로운 메소드를 만들어야 하는 상황이 발생했다. 자칫 잘못하면 내가 만든 오픈소스를 사용한 사람들은 전부 오류가 발생하고 수정을 해야 하는 일이 발생할 수도 있다. 이럴 때 사용하는 것이 바로 default 메소드다. 결론적으로 내용을 정리하게 되면추상 클래스에서 새로운 메서드를 추가해야 한다면 abstract를 추가하지 않는다.인터페이스에서 새로운 메서드를 추가해야 한다면 default 메서드를 사용한다.default 메서드가 추가 되면서 추상 클래스와 인터페이스를 언제 사용해야 하는지 잘 모르겠습니다...! 감사합니다!