"Static method"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-source +syntaxhighlight))
 
(다른 사용자 한 명의 중간 판 2개는 보이지 않습니다)
1번째 줄: 1번째 줄:
;class method
;static method


==Python==
==Python==
[[category: Python]]
[[category: Python]]
<source lang='Python'>
<syntaxhighlight lang='Python'>
class myUtil(object):
class myUtil(object):
     def square(x):
     def square(x):
9번째 줄: 11번째 줄:
print( myUtil.square(3) )
print( myUtil.square(3) )
# 9
# 9
</source>
</syntaxhighlight>


==같이 보기==
==같이 보기==
*[[class]]
*[[class]]
*[[정적 메소드]]

2020년 11월 2일 (월) 02:31 기준 최신판

class method
static method

1 Python[ | ]

class myUtil(object):
    def square(x):
        return x * x

print( myUtil.square(3) )
# 9

2 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}