(First exercise for Java)