java - An interview topic: What can go wrong with this code? -


a simple calculator class that's wired spring bean in web application:

public class calculator {      int result;       public int addtwonumbers(int first, int second) {          result = first + second;          return result;      }  }  

what can potentially go wrong this?

multi threading problems. default spring beans singletons.


Comments

Popular posts from this blog

vb.net - Alternative to the T-SQL AS keyword -

php - MySQLi binding parameters in a prepared statement doesn't work unless inserted after "WHERE" -

ios - CFRelease causing crash in iPad application -