1. A computer implemented method for determining invariants within an object oriented program in a computer, comprising: at least partially running a local analysis of the program wherein the local analysis notes at least one local value of at least one object field of an object within the program at at least one program point wherein the state of the object is either mutable or valid; at least partially running a global analysis of the program, wherein the global analysis stores invariants in a global analysis invariant storage which the at least one object field has held by the local analysis when the object is valid; and combining the local analysis and the global analysis to infer at least one invariant that is not explicitly declared for the object within the program, wherein the combining comprises: the local analysis reaching a program point marked by a pack statement where the object transitions from mutable to valid, the at least one local value of the at least one object field associated with the valid object being passed to the global analysis, and wherein if the at least one local value is not included within the current list of invariants in the global analysis invariant storage, the global analysis adds the at least one local value to the current list of invariants in the global analysis invariant storage for the object, and wherein the local analysis keeps track of the local values of the object encountered until the object transitions from mutable to valid; and the local analysis reaching a program point marked by an unpack statement where the object transitions from valid to mutable, wherein the local values of the mutable object are recorded by the local analysis but the global analysis does not reflect the local values of the mutable object and the local values of the mutable object are not added to the current list of invariants in the global analysis invariant storage, and the global analysis passing information about the stored invariants for the object to the local analysis.