Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String[] sampleArray = {"a","b","a","b","a"}
- String value;
- for (int i=0; i <= sampleArray.length; i++){
- if ( sampleArray[i].equals("a") ) {
- value = "apple";
- } else {
- value = "ball";
- }
- System.out.println(value);
Add Comment
Please, Sign In to add comment