Home
C-Sharp
Interview FAQs

Show

FAQs of level

An object is an instance of a class through which we access the methods of that class. “New” keyword is used to create an object. A class that creates an object in memory will contain the information about the methods, variables and behavior of that class.

A constructor is a member function in a class that has the same name as its class. The constructor is automatically invoked whenever an object class is created. It constructs the values of data members while initializing the class.

You can use following methods - 

str = str.Remove(str.Length -1, 1)

str = str.Substring(0, str.Length-1);


C# .NET makes it almost too easy bu using this line

str = str.TrimEnd(char)

You can use following methods - 

str = str.Remove(str.Length - 1, 1) + ",";

str = str.Substring(0, str.Length - 1) + ",";

Yes, you can say C# is a fully object oriented language. It not only supports the four criteria of OOPs, it also requires that essentially all of your constructs be encapsulated in objects. That is, C# does not let you develop outside of the OOPs methodology in any meaningful way. Where people sometimes say a language is not truly OOPs is where object orientation is optional - such as C++ where you can develop in pure C if you wish.
Data Type refers to the type of data that can be stored in a variable. It also specifies how much memory would be allocated to a variable and the operations that can be performed on that variable. C# is rich in data type which are broadly divided into two categories.

  1. Value Type
  2. Reference Type

Value Types - A value type variable store actual values & are stored in a stacks. Value types are derived from the namespace System.ValueType.Value and are of two types - 

  1. built-in and 
  2. user-defined. 

Reference Types - A reference type variable stores a reference to the actual value. It means reference type contains a pointer to another memory location that holds the actual data & are stored in a heap. Reference types are derived from System.Object and are of two types - 

  1. built-in and 
  2. user-defined. 

PreviousDisplaying 17 of 25Next
Need Help? Contact Us.

Log in

*
*

Forgot password?

*

New User

*
*
*
*