Commit 72e9f773 by patryk

Programy hellołwordowe

parent c0d9ca2d
package hello;
import java.util.Random;
public class DzienTygodnia {
public static void main(String[] args) {
Random random = new Random();
int numer = random.nextInt(1, 8);
String dzien = switch(numer) {
case 1 -> "poniedziałek";
case 2 -> "wtorek";
case 3 -> "środa";
case 4 -> "czwartek";
case 5 -> "piątek";
case 6 -> "sobota";
case 7 -> "niedziela";
default-> "nie powinno się to zdarzyć";
};
System.out.println("Dzień numer " + numer + " to jest " + dzien);
}
}
package hello;
public class Hello {
public static void main(String[] args) {
System.out.println("Hello Maven!");
}
}
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