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

Issues changing the value of an element in an array in matlab -

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

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