반응형
Notice
Recent Posts
Recent Comments
Link
목록오버라이딩 (1)
말랑말랑제리스타일
오버라이딩과 오버로딩의 차이는??
오버라이딩과 오버로딩은 명확히 다른 개념인데 이름이 비슷하다 보니까 종종 헷갈려 하시는 분들이 있더라구요 일단 메서드 오버로딩은 뭐냐? 매개변수의 타입(자료형) 또는 개수가 다르고 이름만 같은 함수를 말합니다 namespace overloading_and_overriding { class Program { static void Main(string[] args) { print_hello(3); print_hello("HELLO"); Console.WriteLine(print_hello(3,"hello")); } static void print_hello(int n) { for (int i = 0; i < n; i++) { Console.WriteLine("hello"); } } static string ..
프로그래밍/파이썬
2022. 1. 6. 13:15