- 1

Java help

I have a java problem who can help me please? Given a queue of integers. Process the queue so that only even items remain in the queue.

8th Apr 2022, 3:27 PM
Daniel Alexis
5 Answers
+ 1
What is the problem? Link your code so we can see what is going on.
8th Apr 2022, 3:57 PM
Lisa
Lisa - avatar
+ 1
LINK the code, that means: Go yo code section, click +, select Java, put your code in there, save. Come to the threads, click +, sort for My Code Bits, select your code.
8th Apr 2022, 5:14 PM
Lisa
Lisa - avatar
0
static public void main(String[] args) { // Pushing elements into the queue Queue<Integer> q = new LinkedList<>(); q.add(4); q.add(5); q.add(-2); q.add(-3); q.add(11); q.add(10); q.add(5); q.add(6); q.add(8); if (pairWiseConsecutive(q)) { System.out.println("Yes"); } else { System.out.println("No"); } } }
8th Apr 2022, 5:05 PM
Daniel Alexis
0
I started to do something but it doesn't respond to the exercise
8th Apr 2022, 5:07 PM
Daniel Alexis