Terminology Flashcards
what is a class?
A class is like a blueprint of a specific object. A class enables you to create your custom types by grouping variables of other types, methods, and events.
What is the difference between a class and an object?
In c#, Classes and Objects are interrelated. The class in c# is nothing but a collection of various data members (fields, properties, etc.) and member functions. The object in c# is an instance of a class to access the defined properties and methods.
What are namespaces in c# .NET?
Namespaces are used in C# to organize and provide a level of separation of codes. They can be considered as a container which consists of other namespaces, classes, etc.
what is a boolean and what is it’s default value?
Boolean value= True or False default: False
what is a byte and what is it’s range and default value?
8-bit unsigned integer from 0 to 255 default=0
name 3 variable types that require a letter also-
decimal =m double = d float = f
what is type conversion and what are it’s 2 forms?
Type conversion is converting one type of data to another type. It is also known as Type Casting. In C#, type casting has two forms − Implicit type conversion − These conversions are performed by C# in a type-safe manner. For example, are conversions from smaller to larger integral types and conversions from derived classes to base classes. Explicit type conversion − These conversions are done explicitly by users using the pre-defined functions. Explicit conversions require a cast operator. example: ———————————————- Using System; namespace TypeConversionApplication { class StringConversion { static void Main(string[] args) { int i = 75; float f = 53.005f; double d = 2345.7652; bool b = true; Console.WriteLine(i.ToString()); Console.WriteLine(f.ToString()); Console.WriteLine(d.ToString()); Console.WriteLine(b.ToString()); Console.ReadKey(); } } }
what is a variable?
A variable is nothing but a name given to a storage area that our programs can manipulate. Each variable in C# has a specific type, which determines the size and layout of the variable’s memory the range of values that can be stored within that memory and the set of operations that can be applied to the variable.
What is an interface?
basically like a contract-it tells a class what must be in it.
what are the 4 things an interface can define?
- methods 2. properties 3. indexes 4.events
what forces a class to implement any of 4 pieces of information?
interfaces
are interfaces public or private?
interfaces are ALWAYS public
what is the naming convention for Interfaces
always start with capital “I” then the name such as “IMyInterface”
what is the default access modifier for Interfaces?
public- Interfaces must be public therefore if no access modifier is given the default is public
if you define a method within an Interface- what should the access modifier be?
you can drop the access modifier because Interfaces are always public