Programming language2 TypeError: super(type, obj): obj must be an instance or subtype of type 에러 이유 및 해결방법 1. Error Code Class A: def func(x: int): return x + 1 Class B(A): def use_func(): a = [super().func(i) for i in range(3)] print(a) the original code is different and has been modified since posting it online could cause code leaks of the company I am working for. Yet, I believe this code explains the prob perfect. I got an error in this line: a = [super().func(i) for i in range(3)] 2. The cuase,.. 2023. 7. 13. 자바 인터페이스 vs 추상클래스 (Java Interface vs Abstract Class) 06.16.2023 1. 인터페이스(Interface)와 추상클래스(Abstract Class)의 정의(Definition) 1-1. 추상클래스의 정의 하나 이상의 메소드가 abstract이다. 미완성 설계도라고 볼 수 있다. 1-2. 인터페이스의 정의 모든 메소드가 abstract이다. 청사진(Blue Print)라고 볼 수 있다. 2. 공통점 (Things In Common) 2-1. 하는 일 추상클래스와 인터페이스가 하는 일은 상속받는 클래스가 추상메소드를 구현하도록 하는 것이다. 2-2. 인스턴스화 할 수 없다. new 키워드의 사용이 불가능하다 3. 차이점 (Differences) 3-1. 존재 이유 추상클래스는 자식 클래스들이 상속받아 추상메소드들의 기능 확장 및 이용이 존재 이유이다. 인터페.. 2023. 6. 16. 이전 1 다음