They are both correct in the sense of producing correct value.  I prefer the former as that value is declared at compile time and the method below requires you to have a valid object handle.