xxxxxxxxxx
class MyClass {
static myStaticVariable: string = "Hello, static variable!";
static myStaticMethod() {
console.log(MyClass.myStaticVariable);
}
}
// Accessing the static variable
console.log(MyClass.myStaticVariable); // Outputs: Hello, static variable!
// Calling the static method
MyClass.myStaticMethod(); // Outputs: Hello, static variable!