I'm having a problem with passing arguments, and I figure it's something really stupid that I'm doing wrong. The arguments are going into the routine right, but the routine is suppose to modify them and return the modified values back. What's coming back is the original values.
When you pass something into a method, you basically make a copy of it. in your case, you'll have a datePascha from the main method, then inside your getDateOfPacha method, you create a second variable called dateOfPascha, and you give it the same value.
When you change dateOfPascha inside your method, that does nothing to datePascha outside of your method.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Joined: Sep 11, 2007
Thanks. From the article I cheated, passing an array in and out, then reassigning the array to a scalar. Not the best method, but quick and works.
Do you have a link to something that would explain the Data Class?
Originally posted by Bill Shirley: If you find yourself passing two values to a function, and wanting to return the two values, those values prob'ly belong in their own class. And indeed there is a Data class in java you can use.
Bill, you mentioned a "Data class", that is what I was asking about, not the Date routines. Do you have a link to something about the Data class?
Joined: Nov 08, 2007
Originally posted by Mike Lipay: Bill, you mentioned a "Data class"... class?