Thursday, June 09, 2005

Interview



using System;

namespace temp
{
class test
{
void method (int a )
{
Console.WriteLine("first");

}

int method (int b )
{
Console.WriteLine("Second");
}

}
class Class1
{
[STAThread]


static void Main(string[] args)
{

test obj = new test();
obj.method(10);


}
}
}


Ans : It wil give the Compile time Error.Coz method overloading depends on the Same name with different Signatures not depends on the return type.Here return type may be different but signature is same.

----------------------------------------------------------


using System;

namespace temp
{

class Class1
{

static void Main(string[] args)
{

int i =20,k=0;
for (int j=1;j<i;j=1+4*(i/j))
{
k+=j<10?4:11;
}
Console.WriteLine(k);
Console.ReadLine();
}
}
}

What is output???

4
---------------------------------------------------------------


After which event,u cannot modify the ViewState???

If i am not maintain the viewstate what will i do???

What are all the CLR Components????
JIT
CLS
CTS
GC


Diff B/w Dataset and DataReader????
Diff b/w String and StringBuilder????
What are all diffrent ways creating Public assembly???
what is the diff between oninit and pageinit????
What will happen when you post the form???

Wednesday, June 01, 2005

Get the Number of weeks from particular Month



class MonthWeek
{


static void Main(string[] args)
{
DateTime dt = new DateTime(2005,2,1);
int days = DateTime.DaysInMonth(2005,2);
int week=0;
for(int i =1;i <= days ;i++)
{
if(dt.DayOfWeek.ToString()=="Sunday")
{
week += 1 ;
}
dt = dt.AddDays(1);

}
Console.WriteLine(week);
Console.ReadLine();
}
}