battle programming a forum for elite programmers with extreme will power to sharpen theire skills
 
HomeSearchRegisterLog in
Share
 

 java finally is defer on swift

Go down 
AuthorMessage
Moti Barski
super
super
Moti Barski

Posts : 415
Join date : 2011-08-02

java finally is defer on swift Empty
PostSubject: java finally is defer on swift   java finally is defer on swift EmptyMon 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 emp it up
Back to top Go down
 
java finally is defer on swift
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
battle programmers alliance :: battle programming alliance :: battle programming-
Jump to: