TypeScript

implements (TS)

Në shqip përdoret i njëjti emër.

ShpjegimiSQ

class Qen implements Kafshe i thotë TypeScript-it ta kontrollojë që klasa ka të gjitha vetitë dhe metodat e interface-it. S'trashëgon kod — vetëm kontrollon formën.

EnglishEN

class Dog implements Animal tells TypeScript to check that the class has every property and method of the interface. It inherits no code — it only checks the shape.

Si ta mendosh

Si inspektori që kontrollon nëse shtëpia ndjek planin.

Lexoje në anglisht

Like an inspector checking whether the house follows the plan.

Shembull koditypescript

interface Forme { siperfaqja(): number }
class Katror implements Forme {
  constructor(private a: number) {}
  siperfaqja() { return this.a ** 2; }
}

Terma të lidhur