Example of a class with methods and a parameterised constructor