Git Product home page Git Product logo

java-study's Introduction

Java-study

1. Generic(제네릭)

  • 컴파일 과정에서 타입 체크를 해주는 기능이다.
  • 사용할 수 있는 객체 타입을 컴파일 시에 미리 체크를 해주기 때문에 타입 안정성을 높이고, 형변환의 번거로움을 덜어준다.
  • ex) Collection에 특정 객체만 추가할 수 있도록 하는 것이 제네릭이다.
        제네릭을 사용하면 Collection 내부에 들어온 객체가 내가 의도한 값인지 별도로 체크하는 로직을 구현할 필요가 없어진다.  
    

2. Builder Pattern

  • 객체 생성방법 : 생성자 패턴, 정적 메소드 패턴, 수정자 패턴(Setter), 빌더 패턴
  • 빌더 패턴을 사용하여 객체 생성시 장점
    • 필요한 데이터만 설정가능
      : 동적으로 필요한 데이터만 객체 생성시 초기화할 수 있다.
    • 유연성
      : 클래스에 새로운 변수 추가해야 하는 경우, 기존의 코드에 영향을 주지 않고 변수를 추가할 수 있다.
    • 가독성
      : 변수에 설정되는 값을 쉽게 파악할 수 있다.

java-study's People

Contributors

heeom avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.