title: Using Apache POI to write in xlsx file, Getting expected answer in the last column of the file
body: <p>I am learning how to write in the xlsx file using Apache poi,Now in the below code i am using 2 array.
  1.Month 2.Logging_Hours.</p>
  
  <p>I am using Month array to assign the column name in the first row and it work fine for me.Now what i want the another Array in my code Logging_Hours print in each column but i am not getting the expected answer by using the below code.</p>
  
  <p>For_Expected refer to the screen :"Expected_Xlsx"
  For_Actual refer to the screen :"Actual_Xlsx"</p>
  
  <pre><code>public class Writing_xlsx {
  
    public static void main(String[] args) throws IOException {
  
      Workbook wb = new XSSFWorkbook();
  
      Sheet sheet1=wb.createSheet("SheetOne");
  
      String [] Month={"January" , "Feb", "March","Apr"};
      int [] Logging_Hours={ 7 ,5, 9,10};
      int f=0;
      System.out.println(Month[0]);
  
      Row r=sheet1.createRow(f);
  
      for(int i=0;i&lt;4;i++){
  
      r.createCell(i).setCellValue(Month[i]);   
  
      }
  
      for(int c=0;c&lt;4;c++){}
          int d=0;
          while(d&lt;4){
  
          for(int rn=1;rn&lt;=4;rn++)    {
  
              r=sheet1.createRow(rn);
              r.createCell(d).setCellValue(Logging_Hours[rn-1]);
              System.out.println(Logging_Hours[rn-1]);
  
          }
          d++;
          }
  
          FileOutputStream fileOut = new FileOutputStream("workbook.xlsx");
  
      wb.write(fileOut);
      fileOut.close();    
      wb.close();
  
  }
  
  }
  </code></pre>
  
  <p>For_Expected refer to the screen :"Expected_Xlsx"</p>
  
  <p><a href="https://i.stack.imgur.com/qo3LF.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qo3LF.jpg" alt="This is the expected screen after running the programm"></a></p>
  
  <p>For_Actual refer to the screen :"Actual_Xlsx"</p>
  
  <p><a href="https://i.stack.imgur.com/xmJJE.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xmJJE.jpg" alt="This is the actual screen i am getting"></a></p>
  
  <p>Thank You in advance ,Sorry for the bad code i am just in a learning phase.</p>