Question: private boolean wellFormed ( ) { / / Check the invariant. / / 1 . data is never null if ( data = = null

private boolean wellFormed(){
// Check the invariant.
//1. data is never null
if (data == null) return report("data is nu11"); // test the NEGATION of the conditior
//2. The data array is at least as long as the number of items
// claimed by the sequence.
// TODO
//3. currentIndex is never negative and never more than the number of
// items claimed by the sequence.
// TODO
// If no problems discovered, return true
return true;
}
Can help me to complete todo
private boolean wellFormed ( ) { / / Check the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!