Which object oriented terms are supported by TypeScript?
Which object oriented terms are supported by TypeScript?
TypeScript supports several object-oriented terms and concepts integral to object-oriented programming (OOP). These include:
Classes: TypeScript allows the definition of classes using the class
keyword. A class in TypeScript is a blueprint for creating objects with pre-defined properties and methods[1][2][3][4][5][6][7].
Objects: Instances of classes represent objects in TypeScript. These objects can encapsulate data and functionalities[1].
Inheritance: TypeScript supports inheritance, allowing classes to inherit properties and methods from other classes. This is achieved using the extends
keyword[1][2][3][4][5][6][7].
Polymorphism: This OOP concept allows methods to do different things based on the object it is acting upon, which is supported in TypeScript through method overriding and interfaces[1][4][5][6][7].
Encapsulation: TypeScript supports encapsulation through access modifiers like public
, private
, and protected
, which control the accessibility of class members[1][4][5][6][7].
Abstraction: TypeScript allows abstraction, which means hiding the complex implementation details of a class and exposing only the necessary parts of the object[4][5][6].
Interfaces: TypeScript uses interface...
junior
Gợi ý câu hỏi phỏng vấn
Chưa có bình luận nào