I've always used Java 8 and I like Java for its strong typing, so I'm surprised to learn about the "var" in Java 10. I'm not sure if I'll like it or not, but anyway thank you for the information!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks for the comment.
I know I can do without StringBuilders, but I make it a rule to use them for performance.
Using the iterative Java code above, it took 14 seconds when the parameter is 10000.
With this code:
it took 243 seconds for 10,000 steps!
I've always used Java 8 and I like Java for its strong typing, so I'm surprised to learn about the "var" in Java 10. I'm not sure if I'll like it or not, but anyway thank you for the information!