Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Arrays;
- import java.util.List;
- public class Main {
- public static void main(String... args) {
- List<String> listaSlow = Arrays.asList("Pierwsze", "Drugie", "Trzecie");
- System.out.println("Pętla for each:");
- for(String wartoscZListy : listaSlow) {
- System.out.println("Wypisuję z for eacha: " + wartoscZListy);
- }
- System.out.println("Zwykla petla: ");
- for(int i = 0; i < listaSlow.size(); i++) {
- System.out.println("Wypisuje z for-a: " + listaSlow.get(i));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement