Access class methods in one line only when you use brackets after class name.
Hello, I’m hoping someone can explain why you can access a class method in a single statement only when you use brackets after the class name.
For example, I have a class called Data, with method stats. Why does Data.stats raise and error, but Data().stats does not raise an error.
The brackets are not required to instantiate the class, i.e. D = Data is the same as D = Data().
Thanks,
Dale.Hello, I’m hoping someone can explain why you can access a class method in a single statement only when you use brackets after the class name.
For example, I have a class called Data, with method stats. Why does Data.stats raise and error, but Data().stats does not raise an error.
The brackets are not required to instantiate the class, i.e. D = Data is the same as D = Data().
Thanks,
Dale. Hello, I’m hoping someone can explain why you can access a class method in a single statement only when you use brackets after the class name.
For example, I have a class called Data, with method stats. Why does Data.stats raise and error, but Data().stats does not raise an error.
The brackets are not required to instantiate the class, i.e. D = Data is the same as D = Data().
Thanks,
Dale. object oriented, method calls MATLAB Answers — New Questions









