The above assumes the cash flow at time 0 is negative and other cash flows are positive. Cash flows can be positive or negative at any point in time, however. To compute payback, find where the cumulative cash flow becomes positive. For mutually exclusive projects, the rule is to accept the project with the shortest payback. In effect the 'long' project's payback of 2.5 above ignores the cash flow in year 4.
Some companies use payback however.
A couple of comments about discounted payback. Thus, some projects which do not satisfy an arbitrary payback cutoff but have positive NPV's may be rejected. T7.6 illustrates the method. In summary, it does not have any real economic meaning. For independent projects the firm should accept all projects for which IRR exceeds the cost of capital.