Rectangle is a class. You want to get the dimensions of a particular instance of Rectangle. But the way you're calling it, it looks like you're trying to get the dimensions of the entire Rectangle...