Moti Barski super


Posts : 415 Join date : 2011-08-02
 | Subject: java finally is defer on swift Mon Nov 19, 2018 1:35 pm | |
| - Code:
-
public static String enStar(String word) { Boolean fin = false;
String result = ""; for (int i = 0; i < word.length() + 2; i++) { result += "*"; } try { return result; } finally { // this code line runs always before the return, the same as defer in the // swift programming language System.out.println("why is this running twice ?!"); } } see comments in the function above :fast: _________________ MB over and out  |
|