I was asked this question in an interview and I said the answer was Managed. The interviewer seemed surprised. My question is even though it access a file (a native/unmanaged resource) but isn’t this class Managed? Or do you think I should have some follow up questions to get more clarification?
Share
According to ILSpy,
FileStreamcontains an awful lot of managed code, so you could argue that it is managed. However, ultimately all file I/O must resolve down to Win32 P/Invoke calls, so you could argue that it is a wrapper round unmanaged code. It rather depends on your definitions.