Problem with object
Hello
Suppose I have an object :
PassingPerson(name, nr);
It sends the name, nr to the method
private void PassingPerson(String name, String nr) {
Source code? etc....
}
How can I loop the object that it sends each time a new object with other argument to the method? For example
Fred 001
Fred 002
Fred 003
[376 byte] By [
DavyPa] at [2007-11-27 9:06:30]

> Suppose I have an object :
>
> PassingPerson(name, nr);
That's a call to a poorly named method, not an object.
> How can I loop the object that it sends each time a
> new object with other argument to the method? For
> example
> Fred 001
001 is not a number but a String. So use a for loop, create your string using the loop's counter, and be done.
Although it's a dumb idea to use a String if you want to have a number.
You have put the method name as the class name, hence it becomes a constructor. So this program doesn't compile.
Again, you are passing integer number to string so again compiler error.
If you want to make more instances using for loop, then take some variable, increment it by 1, name value is contstant for all, so doesn't matter.