title: Java: How to create a room with people having random birthdays?
body: <p>This is my second day on Java. I came across an interesting question on the Birthday Paradox.</p>
  
  <ol>
  <li>Generate a random birthday.</li>
  <li>Create a Person with a random birthday.</li>
  <li>Build a function to check if two persons have the same birthday.</li>
  <li>Create a Room with a given number of persons n.</li>
  <li>Build a function to check if at least two persons in a Room have the same birthday.</li>
  </ol>
  
  <p>However, I am stuck on how to create a 'Room' with 'persons' and then comparing the persons' birthdays.</p>
  
  <p>Does anyone know how to do this?</p>
  
  <p>Thank you for your effort and time! :)</p>
  
  <pre><code>    class Person {
      int age;
      }
  
      class Room {
      int Person;
      }
  
      public class BirthdayParadox {
      public static void main(String[] args) {
          int x = (int) (Math.random() * 364);
          int y = (int) (Math.random() * 364);
          long r = Math.round(x);
          long s = Math.round(y);
  
          Person person1 = new Person();
          person1.age = (int) r;
  
          Person person2 = new Person();
          person2.age = (int) s;
  
          if (person1.age == person2.age) {
  
              System.out.println("Same!");
          }
  
          else if (person1.age != person2.age) {
              System.out.println(person1.age + " " + person2.age);
          }
  
      }
  
      }
  </code></pre>