Static Members of Classes in C#
Adrian Lupasc
Additional contact information
Adrian Lupasc: Dunarea de Jos University of Galati, Romania
Economics and Applied Informatics, 2017, issue 3, 26-32
Abstract:
The C# language is object-oriented, which is why the declared member data must be part of a class. Thus, there is no possibility to declare certain variables that can be accessed from anywhere within the application, as it happens, for example, with global variables at the C language level. Making this work in C# is possible through static members of the class. Declaring a class implies defining some of its member data that later receive values when creating each object. A static member of the class can be interpreted as belonging only to the class, not to the objects subsequently created, which means that for the non-static data, there are as many children as there were objects created, while for the static ones there is only one copy, regardless of the number of created objects. In this regard, this paper presents the main aspects that characterize these abstract concepts of object oriented programming in general and C# language in particular, detailing how to develop an application that includes both static and non-static members. At the same time, particularities in the mirror for the two types of data, restrictions on use and potential limitations are presented.
Keywords: Class; Instance; Static data field; Static method; Static Cconstructor (search for similar items in EconPapers)
Date: 2017
References: View complete reference list from CitEc
Citations:
Downloads: (external link)
http://www.eia.feaa.ugal.ro/images/eia/2017_3/Lupasc.pdf (application/pdf)
Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.
Export reference: BibTeX
RIS (EndNote, ProCite, RefMan)
HTML/Text
Persistent link: https://EconPapers.repec.org/RePEc:ddj:fseeai:y:2017:i:3:p:26-32
Access Statistics for this article
More articles in Economics and Applied Informatics from "Dunarea de Jos" University of Galati, Faculty of Economics and Business Administration Contact information at EDIRC.
Bibliographic data for series maintained by Gianina Mihai ().