+ Reply to Thread
Results 1 to 2 of 2

Thread: What is the difference between an int and an Integer in Java/C#?

  1. #1
    Junior Member
    Join Date
    Jun 2012
    Posts
    13

    What is the difference between an int and an Integer in Java/C#?

    What is the difference between an int and an Integer in Java/C#?

  2. #2
    Junior Member
    Join Date
    Jun 2012
    Posts
    13
    In object oriented languages such as Java and C#, the 'int' type is a primitive , whereas the 'Integer' type is an object.

    The differences between objects and primitives are somewhat beyond the scope of this question, but to summarize:

    Objects provide facilities for polymorphism, are passed by reference, and are allocated from the heap. Conversely, primitives are passed by value and are allocated from the stack.

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts