0

I know that Integer is a class and int is just a number, but when should we use one over another and how to convert Integer to int (and vice versa)?

** Also, there is this question (what is autoboxing by the way) but I am asking WHEN to use int over Integer in actual programming (such as performance issues, ease of use and readability) and vice versa and not the DIFFERENCE between them.

  • take look at https://stackoverflow.com/questions/8660691/what-is-the-difference-between-integer-and-int-in-java – Soheil Rahsaz Sep 02 '21 at 06:43
  • "how to convert Integer to int (and vice versa)" - any decent Java tutorial and the Javadocs provide that information. Look at the `Integer` class specifically. – Thomas Sep 02 '21 at 06:44
  • My recommendation is the same as in https://stackoverflow.com/a/1570425 – Thomas Kläger Sep 02 '21 at 08:29

0 Answers0