TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Anjali Khan
NA
867
223.1k
what is the ans for the below objective type qus in mvc?
Sep 14 2017 3:47 AM
Hi Frnds
A)what is the ans for the below qus
1.
what will be the output of the following program?
[serviceContract()]
public interface ImyService
{
[OperationContract]
int MyMethod();
}
[ServiceBehavior(InstanceContectMode=InstanceContectMode.PerSession)]
public class myservice:IMyService
{
static int m_counter=0;
public int MyMethod()
{
m_Counter++;
return m_counter;
}
}
output -
1 Counter:1
Counter:2
Counter:3
Counter:4
2 Counter: 1
Counter: 1
Counter: 1
Counter: 1
3 Counter: 0
Counter: 1
Counter: 2
Counter: 3
4 Compilation error in services
B)
what will be the output of the following program?
public class myservice:IMyService
{
static int m_counter=0;
public int MyMethod()
{
m_Counter++;
return m_counter;
}
}
static void main(string() args[])
{
MyCalculatorServicesProxy.MyServiceProxy proxy = new MyCalculatorServicesProxy.MyServiceProxy();
Console.wrileline("Counter: " + Proxy.MyMethod());
Console.wrileline("Counter: " + Proxy.MyMethod());
Console.wrileline("Counter: " + Proxy.MyMethod());
Console.wrileline("Counter: " + Proxy.MyMethod());
Console.ReadLine();
}
output
;
1 Counter:1
Counter:2
Counter:3
Counter:4
2 Counter: 1
Counter: 1
Counter: 1
Counter: 1
3 Counter: 0
Counter: 1
Counter: 2
Counter: 3
4 Compilation error in services
Reply
Answers (
1
)
simple example retrieved web serviced asp.net using jquery
how to add calendar in datagridview column