Back to Browse

C#.Net tutorial in Telugu - Class vs Struct - Four Methods From class Object - Oops using C# | ottit

698 views
Oct 19, 2022
29:07

#ottit C#.Net tutorial in Telugu - Class vs Struct - Four Methods From class Object - Oops using C# | ottit Where data is less and inheritance is not required then structure is recommended. Where data is huge and inheritance is required then class is recommended. Class: a. Class is logical. b. It is like a blue print. c. It occupies less space. d. Only one copy is maintained. e. Can be called as Abstract Data type. f. For class there is no life time. Syntax : class Name of the Class { // variables i.e., data //methods. i.e., services } Object: a. It is physical. b. Runtime instance of class is called Object. c. For one class we can create any number of objects. d. Even though all the objects are created from same class, but each object is with independent memory locations with their copy of variables and values and there is no relation or dependency between the objects. e. It is reference type. f. Object is with lifetime i.e., Creation and destruction. Syntax: Class Name object reference variable = new Class Name( ); Note: Every class automatically becomes child to Object class, So that every class gets four inherited methods. a. GetType( ) – Returns metadata of an Object. b. GetHashCode( ) – Returns Address of the Object’s memory. c. Equals( ) – Used to Compare two Objects. d. ToString( ) – Returns information object in string format.

Download

0 formats

No download links available.

C#.Net tutorial in Telugu - Class vs Struct - Four Methods From class Object - Oops using C# | ottit | NatokHD