Students, please be sure to log in. This site does not use cookies and does not track/store work submitted when not signed in.
Unit 7 Problems
Java Reference Sheet
either24
Objective: Write program code to create, traverse, and manipulate elements in 1D array or ArrayList objects.Given a list of ints, return
true
if the list contains a 2 next to a 2 or a 4 next to a 4, but not both.either24([1, 2, 2]) -> trueeither24([4, 4, 1]) -> true
either24([4, 4, 1, 2, 2]) -> false
The following are methods of a list that can be used to manipulate the contained data.