hi i've got this code, I want to store this in a file and the output will be
"1*2*4*5*6*8*9*10"
can anyone plz help me to find this out...
here is the code
Code:
public String printPositive Integers()
{
for(int i=1; i<=10; i++)
{
System.out.print("*"+i);
}
}
By the way, that code will give you
(so there's an extra * at the beginning.)
To solve this, you could use an if-section in the loop or write the first number outside of the loop or...
Also, about writing files,
this Howto could be what you're looking for. (Although of course, Sun's tutorials are much bigger and therefore you can learn much more.)
Greetings,
Nepomuk