I am aware of a counter approach to do this. I was wondering if there is a nice and compact way to do this.
Legend - your answer could be improved upon; because if you fail numTries times, you swallow the exception. Much better:
numTries
while (true) { try { // break; } catch (Exception e ) { if (--numTries == 0) throw e; } }
1.4m articles
1.4m replys
5 comments
57.0k users