C# 7 ) C# CLASS AND OBJECT
* CLASS AND OBJECT *
- class is a collection of member and method.
- MEMBER :- all variable inside the class are members.
- METHOD :- all function is called method .
- Class keyword is used for class.
Q) Rules for creating a class .
- all class before create to main class programme .
class my
{ // method
public void display()
{
Console.WriteLine("sourabh");
}
}
- All class member or method access inside the main.
Q ) how to create object
- Syntax :- classname objectname = new classname ( ) ;
- main class can't be count in class and object .
- all object is to be create inside the main.
- inside the class all method is to be Private.
Ass class input how to pass in a data
Comments
Post a Comment