Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

15
  • 2
    C#'s primitive int data type does have methods... Commented Mar 14, 2012 at 15:30
  • Could you give an example? Commented Mar 14, 2012 at 15:40
  • var myString = 3.ToString(); (see Int32.ToString()). Note that int in C# is a synonym for Int32, i.e., Int32 is a primitive type (unlike Java, where Integer is different from int). Thus, 3.ToString() in C# does not involve boxing! Commented Mar 14, 2012 at 16:08
  • That's very interesting; the link you provided indicates that 'int' is really an object of the class 'Int32' (or maybe a combination of the primitive and a wrapper class), so by the definition I put: 'int' is not a primitive. :) Commented Mar 14, 2012 at 20:09
  • 1
    @barlop: Java is not descended from C++. If Herbert Schildt can't even get such a simple fact straight, I'm not sure I would trust the rest of the book either. Patrick Naughton, original designer of Java, was a huge Objective-C fan. In fact, he had already given notice to work on Objective-C at NeXT, when Scott McNealy convinced him to stay at Sun and design a new language. James Gosling, the other original designer, was very familiar with Smalltalk (direct ancestor of Objective-C) and Lisp (inspiration for Smalltalk). Later on, several members of the Objective-C design team moved to Sun. Commented Apr 20, 2014 at 2:27