I am using a for loop and i want to print anwer vertically with the number. but rite now i am getting the answer horizontally i also \n but no luck below is the code.
public String getMultiStringInformation(int num, String str) throws RemoteException
{
String result = "\n";
for ( int i=0; i<num; i++ )
{
result = result + str + " ";
}
return result;
}
System.out.println("\tThe result is "+MultiStringInfo);
the result which i get is like, 1 2 3.... but i want like
1
2
3
can anybody please help me