Write an expression which satisfies the following statements:
(i) Creates an object of type q
(ii) If m is null, returns n, otherwise returns m
(iii) If x and y are string types, it concatenates x and y

Answer Posted / sam

1)q objQ = new q();
2)string result = m??n;
3) if((typeof(string) == x.GetType()) && (typeof(string) == y.GetType() )
{
String.Concat(x,y);
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between directcast and ctype.

450


How can you read 3rd line from a text file?

523


What are functions c#?

563


What is difference between a type and class?

598


Is typeof c#?

527






What is the use of table aliases?

485


What is typeof undefined?

502


Can a dictionary have duplicate keys c#?

476


Is arraylist thread safe?

486


Why delegates are type safe?

485


What is string class in c#?

483


What is tuple in c#?

522


What is delegation in oops?

514


What are c# collections?

469


What is the use of static members with example using c#.net.

483