Skip to content
เข้าสู่ระบบ

Interfaces

Interface เป็นวิธีกำหนด “รูปร่าง” ของ object ว่าต้องมี properties อะไรบ้าง ช่วยให้โค้ดอ่านง่ายและ reuse ได้

ทำไมต้องใช้ Interface

Section titled “ทำไมต้องใช้ Interface”
ข้อดีคำอธิบาย
Type Safetyบังคับให้ object มี properties ครบ
Reusabilityนำไปใช้ซ้ำได้หลายที่
Extensibilityขยายได้ด้วย extends
Documentationอ่านโค้ดแล้วรู้ structure ทันที
Diagram

เข้าสู่ระบบเพื่อดูเนื้อหาเต็ม

ยืนยันตัวตนด้วยบัญชี Google เพื่อปลดล็อกบทความทั้งหมด