Java

5μ£Όμ°¨ 과제: 클래슀(ν”Όλ“œλ°±, feedback)

ν–₯μ°‘ 2020. 12. 20. 00:38

 

πŸ’‘ 개발자 인터뷰 μ‹œ μ£Όμ˜ν•΄μ•Ό 될 사항에 κ΄€λ ¨λœ μ˜μƒ

  • μ½”λ”© 인터뷰 κ΄€λ ¨ 책듀은 λ¬Έμ œν’€μ΄μ—λ§Œ μ§‘μ€‘λ˜μ–΄ μžˆλ‹€.

www.youtube.com/watch?v=SZEHjcDSEdE


πŸ” ​블둝 μ΄ˆκΈ°ν™”λž‘ μƒμ„±μž μ΄ˆκΈ°ν™” 있으면 μƒμ„±μž μ΄ˆκΈ°ν™”λ‘œ λ¨Ήλ‚˜μš”?

package choi.hyang.study.chapter5;

public class Init {

    private int number;

    // μ΄ˆκΈ°ν™” 블둝
    {
        this.number =10;
        System.out.println("init block");
    }

    // μƒμ„±μž 블둝
    public Init() {
        this.number = 100;
        System.out.println("constructor");
    }

    public static void main(String[] args) {
        Init init = new Init();
        System.out.println(init.number); // 100 좜λ ₯
    }
}

 

Reference

jeeneee.dev/java-live-study/week5-class/

 

[java-live-study] 5주차-클래슀

ν΄λž˜μŠ€μ™€ 객체 ν΄λž˜μŠ€λŠ” 객체지ν–₯ ν”„λ‘œκ·Έλž˜λ°(Object-oriented programming)μ—μ„œ 객체λ₯Ό μƒμ„±ν•˜κΈ° μœ„ν•΄ μƒνƒœμ™€ λ™μž‘μ„ μ •μ˜ν•˜λŠ” μΌμ’…μ˜ 섀계도이닀. μ—¬κΈ°μ„œ κ°μ²΄λž€ μ‹€μ œ μ„Έκ³„μ˜ 사물 λ˜λŠ” κ°œλ…μ„ 컴퓨

jeeneee.dev

 

πŸ” μžλ°”μ—μ„œμ˜ call by value , call by reference

call by value, call by referenceλŠ” Cλ‚˜ C++ μ—μ„œλ‚˜ ν•„μš”ν•œ κ°œλ…μ΄λ‹€.

μžλ°”λŠ” call by value

 

ν•˜λ‹¨ 링크 읽어보기

siyoon210.tistory.com/104

 

μžλ°”μ˜ λ©”μ†Œλ“œ(ν•¨μˆ˜) 호좜 방식 - Call by Value vs Call by Reference

λ©”μ†Œλ“œ(ν•¨μˆ˜) ν˜ΈμΆœ 방식 ν”„λ‘œκ·Έλž˜λ° μ–Έμ–΄μ—μ„œ λ³€μˆ˜λ₯Ό λ‹€λ₯Έ ν•¨μˆ˜μ˜ 인자둜 λ„˜κ²¨ 쀄 수 μžˆμŠ΅λ‹ˆλ‹€. 이 λ•Œ 이 λ³€μˆ˜μ˜ 'κ°’'을 λ„˜κ²¨ μ£ΌλŠ” 호좜 방식을 Call by Value, 이 λ³€μˆ˜μ˜ 'μ°Έμ‘°κ°’' (ν˜Ήμ€ μ£Όμ†Œ, 포인터

siyoon210.tistory.com

 

5μ£Όμ°¨ κ³Όμ œμ— λŒ€ν•œ μ„€λͺ…이 μž˜λ˜μ–΄ μžˆλŠ” 링크

blog.naver.com/swoh1227/222175350122

 

온라인 μžλ°” μŠ€ν„°λ””#5 - 5μ£Όμ°¨ 과제(이진 트리 λ…Έλ“œ μ‚½μž…, μ‚­μ œ, 순회, λ„ˆλΉ„ μš°μ„  탐색(BFS), 깊이 우

유튜브λ₯Ό 톡해 μžλ°” μŠ€ν„°λ””λ₯Ό μ§„ν–‰ν•˜λŠ” ν”„λ‘œκ·Έλž¨μ΄ μžˆμ–΄ ν•œλ²ˆ μ •λ¦¬ν•΄λ³ΌκΉŒ ν•©λ‹ˆλ‹€.(μ•„λž˜λŠ” ν•΄λ‹Ή λ§ν¬μ΄λ‹ˆ μ°Έ...

blog.naver.com

 

μƒμ„±μž 호좜 μ‹œ thisλŠ” μƒλž΅λ˜μ–΄ μžˆμ§€ μ•Šκ³  μƒμ†κ΄€κ³„라면 super만 μƒλž΅λ˜μ–΄ μžˆλ‹€.

package choi.hyang.study.chapter5;

public class Init {

    private int number;

    private String name;

    public Init(int number) {
       // this(); μ•ˆμ¨μžˆλ‹€κ³  μƒλž΅λ˜μ–΄ μžˆλŠ” 것이 μ•„λ‹ˆλ‹€.
        this.number = number;
    }

    public Init() {
        this.name = "whiteship";
    }

    public static void main(String[] args) {
        Init init = new Init(3);
        System.out.println(init.number);
        System.out.println(init.name);
    }
}

 

πŸ” finalν‚€μ›Œλ“œλŠ” μ–Έμ œ μ‚¬μš©ν•˜λ©΄ μ’‹λ‚˜μš”?

final ν‚€μ›Œλ“œλŠ” 상속을 λ§‰μ„λ•Œ μ‚¬μš©ν•œλ‹€.

μ˜€λ²„λΌμ΄λ”©μ„ 막을 λ•ŒλŠ” λ©”μ†Œλ“œμ— 뢙인닀.

programming.guide/java/when-to-create-a-final-class.html

 

Java: When to create a final class | Programming.Guide

A final class is simply a class that can’t be extended. It does not mean that all fields in the class are automatically final or that all references to this class would act as if they were declared as final. You should make a class final when the alterna

programming.guide

 

λ¦¬ν”Œλ ‰μ…˜μ„ μ‚¬μš©ν•˜λŠ” μ μ ˆν•œ 예 (μ—‘μ…€ λͺ¨λ“ˆ 개발)

μ•„ μ—‘μ…€λ‹€μš΄λ‘œλ“œ 개발,,, 쉽고 λΉ λ₯΄κ²Œ ν•˜κ³  μ‹Άλ‹€ (feat. μ—‘μ…€ λ‹€μš΄λ‘œλ“œ λͺ¨λ“ˆ 개발기) - μš°μ•„ν•œν˜•μ œλ“€ 기술 λΈ”λ‘œκ·Έ (woowabros.github.io)

 

μ•„ μ—‘μ…€λ‹€μš΄λ‘œλ“œ 개발,,, 쉽고 λΉ λ₯΄κ²Œ ν•˜κ³  μ‹Άλ‹€ (feat. μ—‘μ…€ λ‹€μš΄λ‘œλ“œ λͺ¨λ“ˆ 개발기) - μš°μ•„ν•œν˜•μ œ

 

woowabros.github.io

 

νž™ μ˜μ—­μ— λŒ€ν•œ 쒋은 μ„€λͺ…

github.com/d-h-k/Java_Study/blob/main/Mobidic/%EC%9E%90%EB%B0%94%205%EC%B0%A8%EC%8B%9C.md

 

πŸ” μ–΄λ…Έν…Œμ΄μ…˜λ„ μ˜€λ²„λΌμ΄λ”©μ΄ λ˜λ‚˜μš”?

μ–΄λ…Έν…Œμ΄μ…˜μ€ 클래슀level μ˜€λ²„λΌμ΄λ”©μ€ λ©”μ„œλ“œ levelμ΄λ―€λ‘œ μ§ˆλ¬Έμ— μžμ²΄μ— 였λ₯˜κ°€ μžˆλ‹€.

 

πŸ” μΆ”μƒν΄λž˜μŠ€μ™€ μΈν„°νŽ˜μ΄μŠ€λŠ” μ–΄λ–¨ λ•Œ μ‚¬μš©ν•˜λ‚˜μš”?

μ΅œκ·Όμ—” μΈν„°νŽ˜μ΄μŠ€κ°€ λ°œμ „ν•΄μ„œ μΆ”μƒν΄λž˜μŠ€λ₯Ό μ‚¬μš©ν•˜λŠ” μ˜λ―Έκ°€ 없어짐 ( default λ©”μ†Œλ“œ λ“±μž₯..)

(default λ©”μ†Œλ“œμ— λŒ€ν•œ μ„€λͺ…은 λ”μžλ°” 8μ—μ„œ λ“£κ³  μ •λ¦¬ν•œ μ—¬κΈ°μ—μ„œ 확인 κ°€λŠ₯ν•©λ‹ˆλ‹€.

κΈ°μ„ λ‹˜ : μΈν„°νŽ˜μ΄μŠ€λŠ” κ·œμ•½μ΄λ‹€.

ν† λΉ„λ‹˜μ˜ μŠ€ν”„λ§3λ₯Ό 보면 "μΈν„°νŽ˜μ΄μŠ€μ˜ κ·œμ•½ κ³Ό νš¨μš©κ°€μΉ˜" 뢀뢄을 읽어보기

 

6주차 과제

λ‹€μ΄λ‚˜λ―Ή λ©”μ†Œλ“œ λ””μŠ€νŒ¨μΉ˜ - java double dispatch에 λŒ€ν•œ μ„€λͺ… 있으면 무쑰건 ν•˜νŠΈ ♥

 

πŸ” μ˜μ–΄ 곡뢀 방법은? (κΈ°μ„ λ‹˜ 방식)

강남에 μžˆλŠ” 학원 λ‹€λ‹ˆκΈ° -> λ§ν•˜κΈ°κ°€ ν¬ν•¨λœ μ‹œν—˜κ³΅λΆ€ν•˜κΈ° (예 : μ•„μ΄μ—˜μΈ , ν† ν”Œ)

 

✨ κ°•μ˜ λ“£λ‹€κ°€ μƒκ°λ‚˜μ„œ μ°Ύμ•„λ³Έ 링크

μžλ°” 클래슀 λ°”μ΄νŠΈ μ½”λ“œ μ½λŠ” 방법

www.slipp.net/wiki/plugins/viewsource/viewpagesrc.action?pageId=8880219

 

μ†ŒμŠ€ 보기

Compiled from "LocalVariable.java" public class LocalVariable { public LocalVariable(); Code: 0: aload_0 1: invokespecial #1 // Method java/lang/Object." ":()V 4: return void local(); Code: 0: iconst_0 // μƒμˆ˜ 0을 push => 어디에 pushν•˜λŠ”μ§€ λͺ¨λ₯΄

www.slipp.net

d2.naver.com/helloworld/1230