1506 CSharp and - Net Concepts CSE 407
1506 CSharp and - Net Concepts CSE 407
No.
using System;
struct A
{
public int x;
}
class B
{
public int x;
public static void Main()
{
A a;
a.x = 100;
A a2 = a;
a2.x = 300;
Console.WriteLine(“{0} {1}”,a.x,a2.x);
B b = new B();
b.x = 100;
B b2 = b;
b2.x = 300;
Console.WriteLine(“{0} {1}”,b.x,b2.x);
}
} (2 Marks)
(b) List the differences between a value type and a reference type. (4 Marks)
(c) List and explain the members of System.Object class. (4 Marks)
(d) A jagged array has same number of columns as the row number. E.g. Row 2 has 2
columns and Row 3 has 3 columns. Create such a jagged array containing 6 rows, and
display it in matrix form. (4 Marks)
6.(a) Using only System.Text.StringBuilder class, overload the + and – operators for a
custom string class. (6 Marks)
(b) Explain fixed and volatile keywords. (4 Marks)
********************************