Académique Documents
Professionnel Documents
Culture Documents
There are two different types of data supported by C#. They are
1) Value types: -They directly contain data. When you declare an int variable, the
system allocates memory to store the value.
2) Reference type: -The reference types do not maintain data but they contain a
reference to the variables, which are stored in memory. This means that if the value
in the memory location is modified by one of the variables, the other variables
automatically reflect the changes value
1 narenselva89@gmail.com
6) Explain about comment entry?
Comments are a part of the program and are used to explain the code. Compilers
ignore comment entries. If a comment entry spans more than one line, it has to be
enclosed within ‘/*’ and ‘*/’. The symbol ‘//’ treats the rest of code within the same
line as a comment.
Applications use operators to process the data entered by a user. Operators like +
and – are used to process variables and return a value. An operator is a set of one or
more characters that is used for computations or comparisons. Operators can
transform one or more data values, called operands into a new data value.
A break statement is used to exit the switch statement. This prevents the execution
of the remaining case structures by ending the execution of the switch case
construct. Each break statement terminates the enclosing switch statement and the
flow of control. If none of the cases match the default case is invoked.
9) Define encapsulation?
An access specifier defines the scope of a class member. A class member refers to
the variables and functions in a class. A program can have one or more classes. You
may want some members of a class to be accessible to other classes. But, you may
not want some other members of the class to be accessible outside the class.
The private access specifier allows a class to hide its member variables and member
functions from other class objects and functions. Therefore, the private member of a
class is not visible outside a class. If a member is declared private, only the functions
of that class can access the member. Even the instance of the class cannot access its
members
2 narenselva89@gmail.com
This specifier allows a class to hide its member variables and member functions to be
accessed from other class objects and functions, except the child class, within the
application. The protected internal access specifier becomes important while
implementing inheritance.
Pass by value is the default mechanism for passing parameters to a method. The
simplest definition of a value parameter is a data type name followed by a variable
name. When a method is called, a new storage location is created for each value
parameter. The values of the corresponding expressions are copied into them. The
expression supplied for each value parameter must be similar to the declaration of
the value parameter.
A structure is a value type data type. When you want a single variable to hold
related data of various data types, you can create a structure. To create a structure
you use the struct keyword.
Enumeration is a value data type, which means that enumeration contains its own
values and cannot inherit or pass inheritance. Enumerator allows you to assign
symbolic names or integral constants.
3 narenselva89@gmail.com