Guest User

Untitled

a guest
Sep 18th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. String[] sampleArray = {"a","b","a","b","a"}
  2. String value;
  3. for (int i=0; i <= sampleArray.length; i++){
  4. if ( sampleArray[i].equals("a") ) {
  5. value = "apple";
  6. } else {
  7. value = "ball";
  8. }
  9. System.out.println(value);
Add Comment
Please, Sign In to add comment