KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
A few days ago, I decided to start learning C#. So, I got a book and started reading and practicing with code. I was surprised when I saw that string in C# is considered a primitive type. But I was more surprised when I saw that string , as well as all the other primitive types in C# have methods. I'm a Java developer and my understanding was that primitive data types don't have methods, only classes have. But in C#, the following is valid: string name = "alex"; Console.WriteLine(name.ToUpper()); How is this possible? Are they really primitives? What am I missing here?
Tags (comma-separated)
Save Edits
Cancel