You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
String is not primitive. It is built-in type, but not primitive. It is reference type, unlike int.
Reported by Nick Murphy (lecturer at Kennesaw State University).
In our lecture section, one of our quiz questions is "Strings (or strings) are a primitive datatype", which we say is false. A student contacted me and showed me page 112 of your textbook, which states that Strings are a primitive datatype in C#.
If you check the "isPrimitive" property of a string in C#, as in the following command:
Console.WriteLine("{0} is a primitive data type: {1}.", typeof(string).Name, typeof(string).IsPrimitive);
it will indicate that C# considers strings to not be primitive.
I believe the issue could be clarified by separating "built-in type" from "primitive" in the description. Strings are built-in to C# (unlike C++), but they are still complex/non-primitive data types compared to ints or chars.
The text was updated successfully, but these errors were encountered:
String is not primitive. It is built-in type, but not primitive. It is reference type, unlike int.
Reported by Nick Murphy (lecturer at Kennesaw State University).
In our lecture section, one of our quiz questions is "Strings (or strings) are a primitive datatype", which we say is false. A student contacted me and showed me page 112 of your textbook, which states that Strings are a primitive datatype in C#.
If you check the "isPrimitive" property of a string in C#, as in the following command:
Console.WriteLine("{0} is a primitive data type: {1}.", typeof(string).Name, typeof(string).IsPrimitive);
it will indicate that C# considers strings to not be primitive.
I believe the issue could be clarified by separating "built-in type" from "primitive" in the description. Strings are built-in to C# (unlike C++), but they are still complex/non-primitive data types compared to ints or chars.
The text was updated successfully, but these errors were encountered: