-
-
Is it possible to have different access modifiers on the get/set methods of a property?
No. The access modifier on a property applies to both its get and set accessors. What you need to do if you want them to be different is make the property read-only (by only providing a get accessor) and create a private/internal set method that is separate from the property.
-
Are private class-level variables inherited?
Yes, but they are not accessible, so looking at it you can honestly say that they are not inherited. But they are.
-
-
Which of the member is not a member of Object
A) Equals ( )B) GetType ( )C) ToString ( )D) Parse( )
-
How do you choose 1 entry point when C# project has more Main( ) method?
A) Not PossibleB) Using /Main along with class name in csc.exeC) By just providing the class name to csc.exe
-
Which of the following is not a member of stringbuilder
A) Append ( )B) Insert( )C) Replace ( )D) Substring( )
-
Which method is actually called ultimately when Console.WriteLine( ) is invoked
A) Append( )B) AppendFormat( )C) Tostring( )
-
Which attribute you generally find on top of main method
A) [assembly]B) [ STA ]C) [ STAThread ]
-
The C# keyword int maps to which .NET type
A) System.Int16B) System.Int32C) System.Int64
-
What Datatypes does the RangeValidator Control support?
Integer.String and Date
-
-
-
-
-
-
-
Find subString in String
Hi All,
I have written the below program to find the substring in the string. in case one word coming multiple time how to handle this situation ? the below program retuning -1 as position which is wrong.
cInput ("abhijit" , "jit")
public int FindSubString(string strSuper, string strSub)
{
char[] charSuper = strSuper.ToCharArray();
... -
-
C# Interview Questions
Ans