[swift] 20. struct 메소드

RudinP·2023년 9월 22일
0

Study

목록 보기
41/227
  • struct도 메소드를 멤버로 가질 수 있다.
struct Friend{
	var name: String
    var age: Int
    
    func myAge() -> Int{
    	return self.age
    }
}
profile
곰을 좋아합니다. <a href = "https://github.com/RudinP">github</a>

0개의 댓글