You put an @ sign in front of the double-quoted string.

String ex = @"This has a carriage return "

The sealed keyword prohibits a class from being inherited.

Objects in object-oriented programming have a lifetime from when they are born (created) to when they die (destroyed or destructed). In the .Net Framework objects  have the following life cycle:

  1. Object creation (new keyword, dynamic instantiation or activation, etc).
  2. The first time around, all static object initializers are called.
  3. The runtime allocates memory for the object in the managed heap.
  4. The object is used by the application. Members (Properties/Methods/Fields) of the object type are called and used to change the object.
  5. If the developer decided to add disposing conditions, then the object is disposed. This happens by coding a using statement or manually calling to the objects Dispose method for IDisposable objects.
  6. If the object has a finalizer, the GC puts the object in the finalization queue.
  7. If the object was put in the finalization queue, the GC will, at an arbitraty moment in time, call the object’s finalizer.
  8. Object is destroyed by marking its memory section in the heap segment as a Free Object.

If we have two classes Baseclass and Childclass, Childclass inherit base class. If we make the object of child class then Baseclass constructor will be call first.

Yes,if we have not override it then it give error. So we must need to override it.

It is available to derived classes and classes within the same Assembly. 

Two. Once you write at least one constructor, C# cancels the freebie constructor, and now you have to write one yourself, even if there is no implementation in it. 
To prevent you from getting the false impression that you have any freedom of choice, you are not allowed to specify any accessibility, it is public by default. They all must be public.
A catch block that catches the exception of type System.Exception. You can also omit the parameter data type in this case and just write catch {}.
Yes, just place a colon, and then keyword base (parameter list to invoke the appropriate constructor) in the overloaded constructor definition inside the inherited class.
PreviousDisplaying 2 of 3Next
1 2 3
Need Help? Contact Us.

Log in

*
*

Forgot password?

*

New User

*
*
*
*