I was asked this question in an interview would appreciate your answers.
Regards;
Mohammad Mohsin
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s unclear exactly what the original interviewer meant – but if he was asking whether it’s possible to combine code in .NET written in C#, J#, and VB.NET – the answer is yes – as long as each class is in a separate assembly. You cannot compile code from multiple languages into a single assembly.
As long as the code written in each is CLS compliant – you should be able to refer to the types and properties declared regardless of language. Language neutrality is one of the core design principles of .NET.
To answer your question from the comments… When you compile code i any .NET language, it is compiled into a common, intermediate representation which preserves metadata and type information. The .NET runtime is therefore able to load and interoperate code that may have been written in different .NET languages. This flexibility is made possible by several features of .NET, including the common type system, the CLR, and MSIL.