text: How do you make a class not instantiable
  A) making class as abstractb) having a priVATe constructorc) making the class sealedd) both a & b
  Which of the following statement is invalid with regards to constructor
  A) constructors should have the same name as class nameb) constructors have to be public so that class can be instantiatedc) constructors can not be overloadedexplanation: constructors can be overloaded with different parameters
  All three options are true about constructor.
  What are constructors in .Net
  Constructor is the special type of methods, which is called when we crate the object for the class.
  Constructor will have same name as class name.
  overloaded constructor can also be there.
  Constructs the value of data members of the class.
  In a multilevel hierarchy how are the constructors are called
  A) topdownb) bottomupc) none
  TOPDOWN is the correct answer. Always base class constructor is called before a sub-class constructor gets called. So, if a class is higher in the class hierarchy, then it will always get called be...
  "c# class Program { public class BaseClass { public BaseClass() { Console.WriteLine("Base class constructor"); ...
  Advantages of static class over class ?
  When to use static class and when to use normal class ?
  WHEN SHOULD WE DO THIS: When we have a normal class and its methods being used very frequently in a given app, then it would speed up things if we made this class a static class with static methods. T...
  A static class can make your implementation simpler and faster because you do not have to create an object in order to invoke its methods. It is useful to organize the methods inside the class in a meaningful way, such as the methods of the Math class in the System namespace.
  How can I set formatting defaults to a chart's series, before populating data to the chart. For example for each chart there must be a different color for each name series like that. Is there any method...
  If youre using C#, simply select property SERIES, select the Series youre setting up, then set its properties. Each Series will have their own properties. But I suppose it only works if you know in advance how many series youre using.
  How to handle exceptions without using try catch finally
  Using (SqlConnection con = new SqlConnection())
  {
  try
  {
  con.Open();
  }
  catch (Exception ex)
  {
  MessageBox.Show(ex.Message);
  }
  }
  The best way to do this would be doing the same in global.asax application_error method.
  Thanks
  Vijay
  How can I check whether a dataset is empty or not in c#.Net
  DataSet ds = new DataSet();
  SqlDataAdapter da = new SqlDataAdapter(sqlString, sqlConn);
  da.Fill(ds);
  It is work i sure
  Wrong. Try this for better results:
  Code
  - DataSet ds = <get a dataset somehow>;
  - if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows > 0)
  - {
  - // There is something in the DataSet.
  - }
  How to find out second maximum number in c#?
  For example."c# int[] t = new int[5]; int max= 0,max2=0; Random rnd = new Random(); for (int i = 0; i < t.Length; i++) { t[i] = rnd.Next(10)...
  The following code fails. Why?
  Int a = 5; int b = 5; object oa = a; object ob = b; debug.Assert(oa == ob, "oa is not equal ob");
  Given code fails bcoz. debug result is wrong.. Please see below int a = 5; int b = 5; object oa = a; object ob = b; Debug.Assert(oa != ob...
  Nice answer peter
  When to use string classes
  When we have string builder which are mutable why we need immutable string classes in c#.
  String: String are immutable that is every time you make changes to a string object, the string is destroyed and a new string is created with modifications you applied to previous string. All this is ...
  String is immutable, meaning, if there is any change in the string value, run time allocates new memory & assign it to the string reference. For the programmer, it looks like the same string but inter...
  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.
  How to fixi it ?How to fixi it ?Code
  - Input ("abhijit" , "jit")
  - public int FindSubString(string strSuper, string strSub)
  - {
  - char[] charSuper = strSuper.ToCharArray();
  - char[] charSub = strSub.ToCharArray();
  -
  - //int position = -1;
  - for (int i = 0; i <= charSuper.Length - charSub.Length; i++)
  - {
  - int counter = 0;
  - for (int J = 0; J < charSub.Length; J++)
  - {
  - if (charSuper[i] != charSub[J])
  - continue;
  - else
  - {
  - i++;
  - counter++;
  - }
  - }
  - if (counter == charSub.Length)
  - position = i - charSub.Length;
  - }
  - return position;
  - }
  Find Substring in string"c# public static bool substr(string mainstr, string str) { char[] main = mainstr.ToCharArray(); char[] sub = st...
  Which of the following statements is not true for interfaces
  A) interface definitions does not have implementationb) interfaces must be declared as publicc) interfaces can be instantiatedd) interface does not have constructorsexplanation: interfaces can only be implemented by inheriting and they can not be instantiated
  C is the correct answer. Interfaces dont have constructors so they cant be instantiated.
  C) Interfaces can be instantiated
  Can we write dotnet console program in UNIX
  Can we write dotnet console program in UNIX ? If yes give one example.
  If you write in Java then the application will run in a JRE on UNIX but you have to compile the application on Windows first. Then deploy it to UNIX.
  Reference variable of interface
  It is possible to create the reference variable of an interface which is 100% abstract in nature.Then why it is not possible to create a reference of an abstract class?
  If a.Equals(b) is true then a.Gethashcode & b.Gethashcode must always return same hash code
  A) trueb) false
  Not necessarily. Actually GetHashCode() can always return the same value... :-) Say "1". And everything will work well. Just Hashtable with such a key will not be efficient. Keys in the hashtable are ...
  FALSE
  Both Equals() and GetHashCode() can be overridden by the developer for user-defined classes, so there is no guaranteed behavior.
  How to clear screen using c# console application...?Like clrscr() in c++..!
  Console.Clear(); its work absolute in c# "c# using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication9 { class stud...
  To clear the screen we can use the clrscr() command followed by ; to clear the input given to the program
  What is reflection and assembly?
  Fetching the assembly information at runtime
  Wap on 3d matrix by using random function print o/p in a file.
  Wap on 3d matrix by using random function print in a file. find the prime numbers from out put of above program. find the even numbers from o/p of 1st program. find the odd numbers from o/p of 1st program.
  Program on 3d matrix using random function print the o/p in file.
  Program on 3d matrix using random function print the o/p in file find the even,odd,prime numbers from above output file. please do needful help thank you
  A & b
  A)making class as abstract
  is Correct answer.