Ask Question
3 April, 07:31

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

+4
Answers (1)
  1. 3 April, 10:07
    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?
Find an answer to your question ✅ “Explain TWO (2) differences between int and Integer in the context of Java programming using suitable example, ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers