title: int variable not initialized
body: <pre><code>private int getBirthdayYear(){
          Random r1 = new Random();
          int x = r1.nextInt(1000);
          int year = 1000+ x;
          return birthdayYear;
        }
            private String getBirthday(){
          int year = getBirthdayYear();
          Random r2 = new Random();
          int y = r2.nextInt(11);
          String monthStr;
          int month = 1 + y;
            switch (month) {
              case 1:  monthStr = "January";
                       break;
              case 2:  monthStr = "February";
                       break;
              case 3:  monthStr = "March";
                       break;
              case 4:  monthStr = "April";
                       break;
              case 5:  monthStr = "May";
                       break;
              case 6:  monthStr = "June";
                       break;
              case 7:  monthStr = "July";
                       break;
              case 8:  monthStr = "August";
                       break;
              case 9:  monthStr = "September";
                       break;
              case 10: monthStr = "October";
                       break;
              case 11: monthStr = "November";
                       break;
              case 12: monthStr = "December";
                       break;
              default: monthStr = "Invalid";
                       break;
          }
  
  
          Random r3 = new Random();
          **int day;// day variable declared as int**
          if(month == 1||month == 3||month == 5||month == 7||month == 8||month == 10||month == 12){
          int z1 = r3.nextInt(30);
          day = 1 + z1;
          }
          else if(month == 2||month == 4||month == 6||month == 9||month == 11){
            int z2 = r3.nextInt(29);
          day = 1 + z2;
          }
          else if(month == 2 &amp; year%4 ==0){
          int z3 = r3.nextInt(28);
          day = 1 + z3;
          }
          else if(month == 2 &amp; year%4 != 0){
          int z4 = r3.nextInt(27);
          day = 1 + z4;
          }
  
          **birthday = monthStr + " " + day + "th " + year;// error here. day variable is not initialized
          return birthday;**
            }
  </code></pre>
  
  <p>This is a code for generating a random birthdate, I'm not sure yet if it works. I'm still working on it. Right now, when I try to compile this code, it says that the day variable is not initialized yet. However, I already stated int day;. What should I do to fix this problem?</p>