Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
Being Java programmer.
Being Java programmer.
Ganish Patil wrote:Where is the code which I posted here ?
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Being Java programmer.
AgreeGanish Patil wrote: . . . you should at least try . . .
Being Java programmer.
Ganish Patil wrote:
Put condition in that loop if counter reaches max index of second array then make it 0 again to start from 0th index's element of array two.
Karthick Pattabiraman wrote:That's more understandable and elegant in my opinion.
Ouch! A for‑each loop and incrementing counters? No.Karthick Pattabiraman wrote:Ok then, here is my solution
Afraid that is even worse.and if at all I need a reset approach I would go with Exception handling. . . .
Being Java programmer.
I wasn't selected to go to mars. This tiny ad got in ahead of me:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|