c sharp data
TRANSCRIPT
-
7/31/2019 C Sharp Data
1/7
Class:derived from Classification
DEF:
Classification information into organized and systematic manner is called Class.
DEF 2:
The written description of an object is called Class.
Object:
Object is an occurrence or instance of a class.
There are two kinds of classes
1 Customized data type2 Abstract data type (ADT)
ADT:
There are three conditions for ADT
1 Declaration of data2 Declaration of operation3 Encapsulation
.>>
-
7/31/2019 C Sharp Data
2/7
.
}
Public void output()
{
}
}
.>>
-
7/31/2019 C Sharp Data
3/7
Function Over Loading:
Change the signature.
Signature Change means
1 change the name of function2 change the number of arguments
3 change the arguments4 change the sequence of arguments
e.g.
Class student
{
Private int rollno;
Private float marks:
// 1ST
TYPE
Student ();
{
.
.
}
//2nd
TYPE
Student (int a); {
.
.
}
//3rd
TYPE
-
7/31/2019 C Sharp Data
4/7
Student (int a float b); {
.
.
}
//4th
TYPE
Student (float b int a);
{
.
.
}
//5th
TYPE
Student1 ();
{
.
.
}
}
..>>
-
7/31/2019 C Sharp Data
5/7
fee = s.fee;
}
Multiple Inheritances:
Person (class) ---------------------Student (class)
|
|
Employee (class)
Multilevel inheritance:
Person (class)-
- Student (class)
- Employee (class)
Reference includes:
1 Base address of object
2 Base address of data3 Meta data
Name Space:
1 Container of class
2 Logical organized
Name Space IUB
{
Class student {
}
-
7/31/2019 C Sharp Data
6/7
}
Name space fee
{
Class student {
..
.
}
}
Call IUB.student
Call fee.student
In both calls we have seen that a function with same name is called but due to the name space
both the call are not same.
Partial:
When more than one developer are working at one class than they use partial key word to join
this class and make one code for compiler .compiler automatically join this class due to the
usage of partial keyword in all pieces class name must same.
Class is reference type (for long data)
Structure is value type (for small data)
Region:
# Region here some description
Here some code which you want to minimize and maximize when we need.
This technique is used to minimized the code.
At the end we use
#endregion
Use of THIS keyword:
-
7/31/2019 C Sharp Data
7/7
Class student {
Private int t; (global)
Public void first ()
{
Int t =10; (local)
This.t =78; (this assign to global) // this key word is use for specific variable t which is defined
in the body of class called global not in the function variable called local variable
}
}
Pause layout:
Stops the layout to execute means stop pasting the form at screen while the changing in design
has done because default constructer make the form with default value so the compiler pause
the layout and when all the changing functions completed then compiler RESUME the layout.