View Count: 0
Duration: 47 mins
Accessed date:
Not Yet Viewed
View Count: 0
Duration: 37 mins
Accessed date:
Not Yet Viewed
View Count: 0
Duration: 25 mins
Accessed date:
Not Yet Viewed
View Count: 0
Duration: 25 mins
Accessed date:
Not Yet Viewed
View Count: 0
Duration: 31 mins
Accessed date:
Not Yet Viewed
View Count: 0
Duration: 55 mins
Accessed date:
Not Yet Viewed
Post your comment / feedback here
 
 

Be the first one to comment about this video

Question No: 1 of 59
class CA
{
      public static void Foo()
      { }
}

class Program
{
    public static void Main()
    {
        CA a;
        a.Foo();
    }
}
The above program gives 
Options:
  1. Compilation Error
  2. Runtime exception is thrown
  3. No error
  4. All of the above
View Answer/Explanation:
a
Explanation:
The method “Foo” is static and can be called as CA.Foo() but not as a.Foo()

Question No: 2 of 59
class CA
{
   //.......
}
class Program
{
   public static void Main()
   {
      CA a;
     // ....
   }
}
what is the default value of 'a'? 
Options:
  1. null
  2. nothing
  3. Explicitly assign in C#
  4. None of the above
View Answer/Explanation:
c
Explanation:
The value is unassigned and the object is not created on the heap.

Question No: 3 of 59
When an object of a class is created, memory  is  allocated for its member variables on the heap but they are not automatically initialized. Is this statement true or false? 
Options:
  1. True
  2. False
View Answer/Explanation:
b
Explanation:
Members are allocated memory on heap and are automatically initialized to some default value based on the datatype.

Question No: 4 of 59
public decimal Balance
{          
  get
  {
     return _Balance;
  }
} 
Options:
  1. Balance is readonly property
  2. Balance is writeonly property
  3. Balance is global variable
  4. Balance is readonly and writeonly property
View Answer/Explanation:
a
Explanation:
Using Get and Set properties field members can be restricted with Read only and write only access. With Get we can return a value where as with Set property we can apply a condition.

Question No: 5 of 59
class CA
{
    private int _Id;
    public int Id
    {
        get
        {

            return _Id;
        }
        set
        {
            _Id = value;
        }
    }
}

What is the datatype of "value" in set block? 
Options:
  1. string
  2. double
  3. int
  4. none of the above
View Answer/Explanation:
c
Explanation:
The datatype of the value would be the type declared for the property.

Question No: 6 of 59
Using a property in VB.NET the field member can be restricted with... 
Options:
  1. ReadOnly access
  2. WriteOnly access
  3. Either ReadOnly or WriteOnly access
  4. None
View Answer/Explanation:
c
Explanation:
Using Get and Set properties we can restrict filed member with Read only and Write only access.

Question No: 7 of 59
What is the default access specifier for a member of a class? 
Options:
  1. public
  2. private
  3. protected
  4. None
View Answer/Explanation:
b
Explanation:
Default access specifiers in c#, • method: private • Class: public internal/private • members (unless an interface or enum): private (including nested classes) • members (of interface or enum): public

Question No: 8 of 59
class CA
{
   private CA()
   { }
}
class Program
{
    static void Main(string[] args)
    {
        CA a = new CA();
    }
}

What happens if the above program is compiled ? 
Options:
  1. No result
  2. Compiles successfully.
  3. Compilation Error.
  4. None of the above.
View Answer/Explanation:
c
Explanation:
Because constructor of class CA is private it is not accessible outside the class. The error would be “ is inaccessible due to its protection level”

Question No: 9 of 59
class Program
{
    static void Main(string[] args)
    {
        CA a;
        a = new CA(10);
        Console.WriteLine(a.Id);       
    }
}
public class CA
{
    private int _Id;
    public int Id
    {
        get
        {
            return _Id;
        }
        set
        {
            _Id = value;
        }
    }
    public CA(int Id)
    {
        Id = Id;
    }
}

What is the Output of this program? 
Options:
  1. 0
  2. 10
  3. compilation Error
  4. Exception
View Answer/Explanation:
a
Explanation:
The assignment statement: Id = Id, assigns the parameter value to itself instead of changing the property “Id”. To assign the value of paramenter “Id” to the property “Id”, use: this.Id = Id;

Question No: 10 of 59
When is the object ready for garbage collection? 
Options:
  1. The value of the object is changed.
  2. Objects does not have reference
  3. When using type casting
  4. None of the above
View Answer/Explanation:
b
Explanation:
All the objects are automatically ready for Garbage Collection when the main object doesn’t have any references.

  1