Newbie
Newbie

Reputation: 19

Java IO with While and If Statement

I want to print contents in two languages both English and Spanish but once i put If statement i am not getting any output though.without statement i get mixed up out put..please advise me on this regard.Where should i put If statement exactly?

Iterator i= selectedDues.iterator();
        pf.write("<div  id=\"div1\">\n");
        System.out.println("D Count :"+ selectedDues.size());
        System.out.println("AppLanguage:" +AppLanguage);

        while (i.hasNext()){

if(AppLanguage.equals("English")) {
            Dues d=(Dues) i.next();
            pf.write("<para>\n");
            pf.write("<p>");
            pf.write("<br/>");
            pf.write("<p>"+ d.getIndustry().getLanguage());
            pf.write("<p>"+d.getIndustry().getApplicantName()+"<br/>");
            pf.write("<p>"+d.getIndustry().getAppAddress()+"<br/>");
            pf.write("<p>"+d.getIndustry().getAppAddLine1()+"<br/>");
            pf.write("<p>"+d.getIndustry().getAppAddLine2()+"<br/>");
            pf.write("<br/>");

                 pf.write("<br/>");
                 pf.write("</p>\n");
                 pf.write("</para>\n");

        }
     }
     else {
               System.out.println("Hello World");
     }
     pf.write("</div>\n");

     pf.write("</body>\n");
     pf.write("</html>\n");
     pf.flush();
     pf.close();

    }catch (Exception e){
        e.printStackTrace();
    }

Upvotes: 0

Views: 44

Answers (1)

Ryan Shtirmer
Ryan Shtirmer

Reputation: 38

It looks like you have an extra closing } after your if statement

Upvotes: 1

Related Questions