16 lines
390 B
TypeScript
16 lines
390 B
TypeScript
/**
|
|
* the class is defined with the export keyword to make it usable outside of the current file
|
|
*/
|
|
export class Car {
|
|
// define the fields
|
|
manufacturer: string = '';
|
|
model: string = '';
|
|
|
|
// define the method print_info
|
|
print_info() {
|
|
console.log('Car Information:');
|
|
console.log(`- manufacturer: ${this.manufacturer}`);
|
|
console.log(`- model: ${this.model}`);
|
|
}
|
|
}
|