0

what is S:C here?

31st Aug 2016, 7:59 PM
Emad Taheri
Emad Taheri - avatar
5 Respostas
+ 2
for(String s:c) represents a for each loop. take a random String type variable, say s. for each time, an element contained in c, will b put into s, it will be printed out, one after the other in a loop.
25th Sep 2016, 7:11 PM
Sharmistha Guha Majumdar
Sharmistha Guha Majumdar - avatar
+ 1
elaborate please, Where did you see that
2nd Sep 2016, 2:44 AM
Shubham Priyesh
Shubham Priyesh - avatar
+ 1
s is the String object while c is the LinkedList object.
6th Sep 2016, 12:00 PM
Naveen Karthik
Naveen Karthik - avatar
0
Hey
31st Aug 2016, 11:16 PM
Басов Михаил
0
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.remove("Green"); System.out.println(c); } } ok if that's the thing bothering you you can try doing this↑↑(see code above↑↑) the output will be same
13th Sep 2016, 12:31 PM
Piyush Tambe
Piyush Tambe - avatar