Saturday, May 12, 2018

C# objective question


Q1:what is use of sealed in c#.
a) allow to inherit the class.
b) declare varaible.
c) prevent Inheritance.
d) None of these.
Ans: c

Q2: which of the following should the methods of a class differ if they are to be treated as overloaded methods?
a) Type of arguments
b) Return type of methods
c) Number of arguments
d) Names of methods
e) Order of arguments
Ans: a,c,e

Q3: If s1 and s2 are references to two strings then which of the following are the correct ways to find whether the contents of the two strings are equal?
a) if(s1 = s2)
b) if( strcmp(s1, s2) )
c) int c;
    c = s1.CompareTo(s2);
d) if (s1 is s2)
Ans: c

Q4:If s1 and s2 are references to two strings then which of the following are the incorrect ways to find whether the contents of the two strings are equal?
a) if(s1 == s2)
b) if( strcmp(s1, s2) )
c) int c;
    c = s1.CompareTo(s2);
d) None of these
Ans: b

 

No comments:

Post a Comment

Featured Post

What is JavaScript? What is the role of JavaScript engine?

  The JavaScript is a Programming language that is used for converting static web pages to interactive and dynamic web pages. A JavaScript e...