Optimal Structure
 Subproblem: t[i] is the maximum sum when the subsequence ends at ith element
Recurrence: t[i] = max(A[i],A[i]+t[i1])
if A[i] is larger, it means the last sequence ends and an new one starts
if A[i]+t[i1 is larger, it means the last sequence increases
Base Cases: t[0] = 0 which means sum of no element is 0

Here is the code
public int maxSubArray(int[] A) { int[] t = new int[A.length+1]; t[0] = 0; int max = Integer.MIN_VALUE; for(int i = 1; i <= A.length;i++){ t[i] = Math.max(A[i1],A[i1] + t[i1]); max = Math.max(t[i],max); } return max; }