<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>cachi-cast.log</title>
        <link>https://velog.io/</link>
        <description></description>
        <lastBuildDate>Wed, 07 Oct 2020 10:14:14 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <image>
            <title>cachi-cast.log</title>
            <url>https://images.velog.io/images/cachi-cast/profile/b02ad54f-ebfa-48c2-90be-26ead71ca7ca/social.jpeg</url>
            <link>https://velog.io/</link>
        </image>
        <copyright>Copyright (C) 2019. cachi-cast.log. All rights reserved.</copyright>
        <atom:link href="https://v2.velog.io/rss/cachi-cast" rel="self" type="application/rss+xml"/>
        <item>
            <title><![CDATA[#binding]]></title>
            <link>https://velog.io/@cachi-cast/binding</link>
            <guid>https://velog.io/@cachi-cast/binding</guid>
            <pubDate>Wed, 07 Oct 2020 10:14:14 GMT</pubDate>
            <description><![CDATA[<h5 id="-함수의-바인딩">* 함수의 바인딩</h5>
<h6 id="함수를-만들어-컴파일을-하면-각각의-코드가-메모리-어딘가에-저장된다">함수를 만들어 컴파일을 하면 각각의 코드가 메모리 어딘가에 저장된다.</h6>
<h6 id="그리고-함수를-호출하는-부분에는-그-함수가-저장된-메모리-번지수주소값이-저장된다">그리고 함수를 호출하는 부분에는 그 함수가 저장된 메모리 번지수(주소값)이 저장된다.</h6>
<h6 id="프로그램-실행-→-함수-호출-→-함수가-저장된-주소로-점프-→-함수-실행-→-원래-위치">&quot; 프로그램 실행 → 함수 호출 → 함수가 저장된 주소로 점프 → 함수 실행 → 원래 위치 &quot;</h6>
<h6 id="위-과정에서-함수를-호출하는-부분에-함수가-위치한-메모리-번지로-연결해-주는-것을-바인딩binding이라고-한다brbr">위 과정에서 함수를 호출하는 부분에 함수가 위치한 메모리 번지로 연결해 주는 것을 바인딩(Binding)이라고 한다.<br/><br/></h6>
<h5 id="-함수를-바인딩하는-2가지-방법">* 함수를 바인딩하는 2가지 방법</h5>
<h6 id="1-정적-바인딩-일반-함수">(1) 정적 바인딩 (일반 함수)</h6>
<h6 id="컴파일-시간에-호출될-함수로-점프할-주소가-결정되어-바인딩-되는-것">컴파일 시간에 호출될 함수로 점프할 주소가 결정되어 바인딩 되는 것.</h6>
<h6 id="2-동적-바인딩-가상-함수">(2) 동적 바인딩 (가상 함수)</h6>
<h6 id="실행-파일을-만들-때-바인딩-되지-않고-보류-상태-둔다">실행 파일을 만들 때 바인딩 되지 않고 보류 상태 둔다.</h6>
<h6 id="점프할-메모리-번지를-저장하기-위한-메모리-공간4-byte을-가지고-있다가-런타임에-결정">점프할 메모리 번지를 저장하기 위한 메모리 공간(4 byte)을 가지고 있다가 런타임에 결정.</h6>
<h6 id="단점--타입-체킹으로-인한-수행-속도-저하--메모리-공간-낭비---가급적-정적-바인딩-사용">단점 : 타입 체킹으로 인한 수행 속도 저하 / 메모리 공간 낭비 -&gt; 가급적 정적 바인딩 사용</h6>
<h6 id="--단점이-있음에도-불구하고-동적-바인딩을-하는-이유">- 단점이 있음에도 불구하고 동적 바인딩을 하는 이유?</h6>
<h6 id="어떤-포인터에-의해-접근되었는-지에-상관없이"><del>어떤 포인터에 의해 접근되었는 지에 상관없이</del></h6>
<h6 id="참조된-인스턴스의-실제-클래스형에-따라-재정의된-함수-호출이-가능brbr">참조된 인스턴스의 실제 클래스형에 따라 재정의된 함수 호출이 가능.<br/><br/></h6>
<h5 id="-understanding-method-calls">* Understanding Method Calls</h5>
<h6 id="suppose-obj-is-declared-to-be-of-type-c">Suppose obj is declared to be of type C.</h6>
<h6 id="consider-a-method-call">Consider a method call:</h6>
<blockquote>
<h5 id="objfargs--args-string">obj.f(args) ; args (String)</h5>
</blockquote>
<h6 id="step1-at-compile-time">Step1: at compile time</h6>
<ul>
<li><h6 id="the-compiler-finds-all-accessible-methods-called-f-in-c-and-its-superclasses">The compiler finds all accessible methods called f in C and its superclasses.</h6>
</li>
<li><h6 id="the-compiler-selects-the-method-whose-parameter-types-match-the-argument-typesoverloading-resolution">The compiler selects the method whose parameter types match the argument types(overloading resolution).</h6>
</li>
<li><h6 id="if-there-is-no-matching-to-the-call-f-then-compile-error-occurs">If there is no matching to the call f, then compile-error occurs.</h6>
</li>
<li><h6 id="if-the-method-is-private-static-or-final-then-the-compiler-binds-the-matched-method-to-the-call-f-static-binding">If the method is private, static, or final, then the compiler binds the matched method to the call f (static binding).</h6>
<h6 id="step2-at-runtime">Step2: at runtime</h6>
</li>
<li><h6 id="the-exact-method-is-found-at-runtime-dynamic-bindingbrbr">The exact method is found at runtime (dynamic binding).<br/><br/></h6>
</li>
</ul>
<h6 id="출처-brbrhttpssecretroutetistorycomentry140819">[출처] <br/><br/><a href="https://secretroute.tistory.com/entry/140819">https://secretroute.tistory.com/entry/140819</a></h6>
<h6 id="chapter-5-core-java-volume-i"><a href="%EA%B0%95%EC%9D%98%EC%9E%90%EB%A3%8C">Chapter 5, Core Java, Volume I</a></h6>
]]></description>
        </item>
    </channel>
</rss>