- 1

Please help me! I start something by didn't work

How to selec the only 4 character Strings within the LinkedList. import java.util.LinkedList; public class MyClass { public static void main(String[ ] args) { LinkedList<String> c = new LinkedList<String>(); c.add("Red"); c.add("Blue"); c.add("Green"); c.add("Orange"); c.add("Cocojambo") for(int i=0, i<c.length , i++) { if(c.get(i).length()>6){ System.out.println(c.add(i)); } } }

8th Jun 2021, 9:44 PM
Remus Tanasa
2 Respuestas
+ 2
fix ";" ``` import java.util.LinkedList; public class Main { public static void main(String[ ] args) { LinkedList<String> c = new LinkedList<String>(); c.add("Red"); c.add("Blue"); c.add("Green"); c.add("Orange"); c.add("Cocojambo"); for(int i=0; i<c.size() ; i++) { if(c.get(i).length()>6){ System.out.println(c.get(i)); } } } } ```
9th Jun 2021, 1:38 AM
VuxxLong
VuxxLong - avatar
0
I'm feeling shamed about my mistake. Thanks mate!
9th Jun 2021, 6:20 AM
Remus Tanasa