Commit 2c00756a by Patryk Czarnik

Drobne poprawki

parent 9e9f6773
......@@ -16,7 +16,7 @@ public class Konkurencja7a {
for (String s : lista) {
System.out.println(s);
if(s.equals("Ela")) {
lista.add("Nowy"); // EXN
lista.add("Nowy"); // EXN (w momencie pobierania następnego elementu)
}
}
}
......
......@@ -29,7 +29,7 @@ public class Sortowanie2 {
System.out.println(lista);
// Drugi sposób utworzenia komparatora: klasa anonimowa
// Składnia dostepna od początków Javy
// Składnia dostępna od początków Javy
System.out.println("\nlista.sort( klasa anonimowa )");
lista.sort(new Comparator<String>() {
public int compare(String s1, String s2) {
......
......@@ -22,7 +22,8 @@ public class ZbieranieDanych5_HashSet {
System.out.print("Podaj kolejne imię: ");
String imie = scanner.nextLine();
if(imie.isEmpty()) break;
zbior.add(imie);
boolean b = zbior.add(imie);
System.out.println(b);
}
System.out.println(zbior);
System.out.println();
......
......@@ -13,7 +13,7 @@ public class ZbieranieDanych7_HashMap {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
// Przykładowo tutaj dla imienia (string) pamiętamy wiek (Integer)
// Przykładowo tutaj dla imienia (String) pamiętamy wiek (Integer)
Map<String, Integer> slownik = new HashMap<>();
while(true) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment