-1

I would like to write my array of objects to an HTML file in a loop. The HTML tags are correct as the table that I want is properly made. However, "menu.ArrObj[i].getName" is literally printed. I would like some help as to how the actual array is to be printed.

FileWriter f = new FileWriter("C:\\drivers\\A.html", true);
BufferedWriter bw = new BufferedWriter(f);
for(int i = 0; i < 15; i++)
 {
     bw.write("</tr><tr><td>menu.ArrObj[i].getName()</td> <td> align=\"right\">menu.ArrObj[i].getConcept() </td> <td align=\"right\"

1 Answers1

3

It seems you just want to replace the BufferedWriter write line with:

 bw.write("</tr><tr><td>" + menu.ArrObj[i].getName() + "</td> <td> align=\"right\">" + menu.ArrObj[i].getConcept() + "</td> <td align=\"right\" ...)
Thomas Shields
  • 8,874
  • 5
  • 42
  • 77