aboutsummaryrefslogtreecommitdiff
path: root/files/ko/glossary/signature/function/index.html
blob: c3091298a7395105fe822a04247df0e346a815ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
title: Signature (functions)
slug: Glossary/Signature/Function
translation_of: Glossary/Signature/Function
---
<p><strong>함수 시그니처</strong>(<em>타입 </em>시그니처, <em>메소드 </em>시그니처)는 {{Glossary("Function", "functions")}} 그리고 {{Glossary("Method", "methods")}}의 입력과 출력을 정의합니다.</p>

<p>시그니처는 다음을 포함합니다:</p>

<ul>
 <li>{{Glossary("Parameter", "parameters")}}와 그들의 {{Glossary("Type", "types")}}</li>
 <li>반환값과 타입</li>
 <li>던져지거나 콜백으로 반환되는 {{Glossary("Exception", "exceptions")}}</li>
 <li>{{Glossary("OOP", "object-oriented")}} 프로그램에서 메소드의 접근 권한에 대한 정보 (<code>public</code>, <code>static</code>, 혹은 <code>prototype</code>와 같은 키워드들).</li>
</ul>

<h2 id="In_depth">In depth</h2>

<h3 id="Signatures_in_JavaScript">Signatures in JavaScript</h3>

<p>{{Glossary("JavaScript")}}<em>약한 타입</em> 혹은 <em>동적 </em>언어입니다. 이것은 여러분이 변수의 타입을 미리 선언하지 않아도 됨을 의미합니다. 타입은 프로그램이 실행되는 동안 자동으로 결정됩니다. 하지만 JavaScript에서의 시그니처는 여전히 여러분에게 메소드에 대한 몇 가지 정보를 제공해줄 수 있습니다:</p>

<pre class="brush: js">MyObject.prototype.myFunction(value)</pre>

<ul>
 <li>메소드는 <code>MyObject</code>라 불리는 {{Glossary("object")}}에 장착되어 있습니다.</li>
 <li>메소드는 <code>MyObject</code><code>prototype</code>에 장착되어 있습니다. (따라서 이 메소드는 {{Glossary("instance method")}} 입니다.) 반대의 경우는 {{Glossary("static method")}}입니다.</li>
 <li>메소드의 이름은 <code>myFunction</code>입니다.</li>
 <li>메소드는 하나의 인자를 받고, 그것의 이름은 <code>value</code> 입니다.</li>
</ul>

<h3 id="Signatures_in_Java">Signatures in Java</h3>

<p>{{Glossary("Java")}}는 VM수준에서 메서드와 클래스를 식벽하는데 시그니처가 사용됩니다.  Java 코드를 싱행하기 위해서는 변수의 타입을 선언해야 합니다. Java는 강한 타입이며, 컴파일 시간에 parameters의 type의 정확성을 검사합니다.</p>

<pre class="brush: java">public static void main(String[] args)</pre>

<ul>
 <li>The <code>public</code> keyword is an access modifier and indicates that this method can be called by any object.</li>
 <li>The <code>static</code> keyword indicates that this method is a class method as opposed to being an instance method.</li>
 <li>The <code>void</code> keyword indicates that this method has no return value.</li>
 <li>The name of the method is <code>main</code>.</li>
 <li>The method accepts one parameter of type String Array. It is named <code>args.</code></li>
</ul>

<h2 id="Learn_more"><code>Learn more</code></h2>

<h3 id="General_knowledge"><code>General knowledge</code></h3>

<ul>
 <li><span>{{Interwiki("wikipedia", "Type signature#Java", "Java internal type signatures")}} on Wikipedia</span></li>
</ul>