Ask Question
17 March, 22:13

Explain TWO (2) differences between int and Integer in the context of Java programming using suitable example,

+3
Answers (1)
  1. 18 March, 00:28
    0
    Int is primitive, integer is an object

    Explanation:

    int i = 6;

    vs

    Integer i = new Integer (6);

    Two different ways of initiation. Also, you can't call any methods onto the int because it is primitive. See here:

    String s = i. toString (); / / This will not work
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Explain TWO (2) differences between int and Integer in the context of Java programming using suitable example, ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers