Little bit more insight into declaring global variables


Your test cases might fail if you declare global variable and didn’t clear them (for vectors or arrays) or initialize them (for integer or some other datatype) in the constructor.
The first method you see is not a method rather it is a constructor. Hope it helps.