Solved

Consider a Class That Uses the Following Variables to Implement

Question 23

Multiple Choice

Consider a class that uses the following variables to implement an array-based stack:
String [ ] s = new String[100];
Int top = 0;
The boolean method to check for an empty stack can be written as:


A) return top;
B) if (top == 0.
Return true;
Else
Return false;
C) if (s == null.
Return true;
Else
Return false;
D) if
Return true;
Else
Return false;

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions