Hi, very nice article to me. What is this VS Code extension you use in your screenshots? Is it something like real C# compiler inside markdown??
Another thought on question 2:
You can have both int and string values in one array.
It can be either true or false, depending on the assumption one makes. If it's an array of strings or ints, it is false. Nevertheless it's also possible to use any C# type, an array of object would also work and the above statement would then be true (I'm not a C# beginner as you may notice).
Regarding question 2, it's entirely possible to make that assumption! However, if it's an object array technically the elements are not int or string but would be object type. So the statement would still be false.
Hmm, I can't fully agree with your above argument, since the underlying (concrete) type does not change when you store something inside a object array.
Ah, in that case I stand corrected 😊 though I haven't really introduced the object type in this course, so the expected answer was false. I should probably reword that question to make it exact!
Thanks for the clarification!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi, very nice article to me. What is this VS Code extension you use in your screenshots? Is it something like real C# compiler inside markdown??
Another thought on question 2:
It can be either true or false, depending on the assumption one makes. If it's an array of strings or ints, it is false. Nevertheless it's also possible to use any C# type, an array of
object
would also work and the above statement would then be true (I'm not a C# beginner as you may notice).Hi, thanks for reading!
I'm using Dotnet Interactive Notebooks extension in VSCode. It's linked in this article: dev.to/coding_mama/c-for-beginners...
Regarding question 2, it's entirely possible to make that assumption! However, if it's an
object
array technically the elements are notint
orstring
but would beobject
type. So the statement would still be false.Thanks again for your comment! 😊
Thanks for your reply!
Hmm, I can't fully agree with your above argument, since the underlying (concrete) type does not change when you store something inside a
object
array.See the following example:
Other types for the array would also work, they just have to satisfy both
int
andstring
, for exampleIComparable
.Ah, in that case I stand corrected 😊 though I haven't really introduced the
object
type in this course, so the expected answer was false. I should probably reword that question to make it exact!Thanks for the clarification!