eclipse - Out put in console -


package lesson1;  public class starprogram {  public static void main(string[] args) {     // todo auto-generated method stub     for(int i=1;i<=3;i++){           for(int j=1;j<=3;j++)           {               system.out.println("*");           }system.out.println();       }   }  } 

for program, getting out put

* * *  * * *  * * * 

but should right?:

* * * * * * * * * 

what problem in program?

this may you. read difference between system.out.print , system.out.println

change

for(int j=1;j<=3;j++)           {               system.out.print("*");           }system.out.println();  

instead of

for(int j=1;j<=3;j++)           {               system.out.println("*");           }system.out.println(); 

Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -