User Tools

Site Tools


Sidebar


Introduction


Basic Tutorials


Advance Tutorials


Useful Techniques


Examples

  • Simple Pipe Weight Calculator
  • Unit Convertor

Sidebar

tutorial:genericandtemplate

This is an old revision of the document!


Generic And Template

Generic คืออะไร

คือการเขียนโปรแกรมให้สามารถใช้ได้กับหลากหลาย DataType โดยทั่วไปเรามักจะใช้ Generic กับการเขียนโปรแกรมดังนี้

  • Generic Procedure/Function
  • Generic Class

1. Generic Procedure/Function

คือการสร้าง Procedure/Function ที่รับค่า(หรือส่งค่า) Argument หลากหลาย DataType

2. Generic Class

คือการสร้าง Class ที่ใช้กับ DataType ใดๆก็ได้ ไม่เฉพาะเจาะจง

tutorial/genericandtemplate.1545537449.txt.gz · Last modified: 2018/12/23 10:57 by admin