Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C# (http://www.go4expert.com/forums/c-sharp/)
-   -   Explanations of access modifiers from compilation units perspective!! (http://www.go4expert.com/forums/explanations-access-modifiers-t3731/)

visualcpp 3Apr2007 16:50

Explanations of access modifiers from compilation units perspective!!
 
I need some indepth info about the access modifiers (public, private, protected, internal and protected internal) from compilation units perspective. Also I have following doubts and need clarifications.

1. Is it possible to make a single assembly based on multiple .cs files? If yes please give the command line command info.

2. Is it possible to have a single module or assembly to be a part of more than one assembly. That is "is it possible to create an assembly based on existing module/assembly which is part of other assembly?

3. How to create an assembly from command prompt which has to take multiple files having partial classes? (For example I have 3 files which are having single class definitions (using partial class concept of C# 2.0) and want to make an assembly from command prompt.

4. Is it possible to create one module from more than one .cs file. If yes please give the command line command info.

5. What is the purpose of having properties in interface?

6. Why we need static class and static constructor?

7. Is it possible to inherit a class from one assembly to an another assembly?

Thanks in advance!!
regards,
visualcpp

shabbir 3Apr2007 17:22

Re: Explanations of access modifiers from compilation units perspective!!
 
Quote:

Originally Posted by visualcpp
1. Is it possible to make a single assembly based on multiple .cs files? If yes please give the command line command info.

Yes. there is no command line but you can add each of the file in the csproj (As we do it in the IDE)
Quote:

Originally Posted by visualcpp
2. Is it possible to have a single module or assembly to be a part of more than one assembly. That is "is it possible to create an assembly based on existing module/assembly which is part of other assembly?

Yup. You can always split the assembly to have the base functionality and derive the class for more specific functionality on some other assembly
Quote:

Originally Posted by visualcpp
3. How to create an assembly from command prompt which has to take multiple files having partial classes? (For example I have 3 files which are having single class definitions (using partial class concept of C# 2.0) and want to make an assembly from command prompt.

I don't use the command line and will not comment on this.
Quote:

Originally Posted by visualcpp
4. Is it possible to create one module from more than one .cs file. If yes please give the command line command info.

Same as above
Quote:

Originally Posted by visualcpp
5. What is the purpose of having properties in interface?

Refer this
Quote:

Originally Posted by visualcpp
6. Why we need static class and static constructor?

To initialize the static member (not in a very strict sense) variables.
Quote:

Originally Posted by visualcpp
7. Is it possible to inherit a class from one assembly to an another assembly?

Yup.


All times are GMT +5.5. The time now is 01:07.