Whenever we start programming
in C# or Object based Compiler. Then we have to instantiate Object. Thus we use
maximum Object to categories the program into small part to optimize its complexity
and length.
CLASS
“The class
is also known as classification that is the specification or characteristic of
any object.”
Or
“Information
about any object is known as classification”.
For example for an Object of student its name, roll no, and
student ID may be its class.
CLASS MEMBERS
There are five class members who classify a class and classes
classify the objects which are.
SYNTAX
Public Class Classname
{
Public members;
}
OBJECT
“Object is
a physical instance that is classified by the class. Number of class makes an
object”. Object is use to implement that program in real life.
For example suppose student is an object.
OBJECT INSTANTIATE SYNTAX
Classname Obj = new Classname ( );
Let suppose student
is a class. How the object could will be for class student.
Student Obj = new Student ( );
WHY WE USE OBJECT?
Object is
made due to the following reason.
1. To categories the program code into parts for better understands.
2. For the reusability of block of code.
3. To utilize less memory storage.
4. To overcome program complexity.
5. To manage the time to written codes.
6. To overcome the execution time of program.
7. To maintain the minimum length of program.
class and object |
click to see examples program.
0 comments:
Post a Comment
Please do not enter any spam link in the comment box