JVM Knowledge

The following rules apply to a statement if (e) S (§14.9.1):

  • V is [un]assigned after if (e) S iff V is [un]assigned after S and V is [un]assigned after e when false.
  • V is [un]assigned before e iff V is [un]assigned before if (e) S.
  • V is [un]assigned before S iff V is [un]assigned after e when true.

The following rules apply to a statement if (e) S else T (§14.9.2):

  • V is [un]assigned after if (e) S else T iff V is [un]assigned after S and V is [un]assigned after T.
  • V is [un]assigned before e iff V is [un]assigned before if (e) S else T.
  • V is [un]assigned before S iff V is [un]assigned after e when true.
  • V is [un]assigned before T iff V is [un]assigned after e when false.