CS 3280 Flashcards

1
Q

Garbage collection

A

Garbage collection

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Differences between a namespace and a class

A

Classes are data types. They are an expanded concept of structures, they can contain data members, but they can also contain functions as members whereas a namespace is simply an abstract way of grouping items together. A namespace cannot be created as an object; think of it more as a naming convention.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Inheritance

A

public class ChangeRequest : WorkItem

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Base class

A

A base class is a class, in an object-oriented programming language, from which other classes are derived. It facilitates the creation of other classes that can reuse the code implicitly inherited from the base class (except constructors and destructors). … A base class may also be called parent class or superclass.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Abstract class

A

An abstract class is a class that is declared abstract —it may or may not include abstract methods. Abstract classes cannot be instantiated, but they can be subclassed. … However, if it does not, then the subclass must also be declared abstract

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Overriding

A

Override, in C#, is a keyword used to replace a virtual member that is defined in a base class with the definition of that member in the derived class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Virtual

A

The virtual keyword is used to modify a method, property, indexer, or event declared in the base class and allow it to be overridden in the derived class. The override keyword is used to extend or modify a virtual/abstract method, property, indexer, or event of base class into derived class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

static

A

Use the static modifier to declare a static member, which belongs to the type itself rather than to a specific object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Const

A

It is a variable qualifier that modifies the behavior of the variable, making a variable “read-only”. This means that the variable can be used just as any other variable of its type, but its value cannot be changed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Ref

A

The ref keyword in C# is used for passing or returning references of values to or from Methods. Basically, it means that any change made to a value that is passed by reference will reflect this change since you are modifying the value at the address and not just the value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Object instantiation

A

When you create a new object in C# for a class using the new keyword, then it is called instantiation. Use the new operator to instantiate a class in C#.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a nameless object

A

In C#, an anonymous type is a type (class) without any name that can contain public read-only properties only. It cannot contain other members, such as fields, methods, events, etc. You create an anonymous type using the new operator with an object initializer syntax.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Delegates

A

A delegate in C# is a type that refers to methods with a parameter list and return type. Delegates are used to pass methods as arguments to other methods

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Using delegates

A
public delegate void printString(string s);
...
printString ps1 = new printString(WriteToScreen);
printString ps2 = new printString(WriteToFile);
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Internal

A

Internal, in C#, is a keyword used to declare the accessibility of a type or type member such that the access is limited to the assembly in which it is declared. An internal modifier is used to prevent the use of a public modifier, which allows access to other assemblies wherever necessary.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

String literals

A

String literals or constants are enclosed in double quotes “” or with @””. A string contains characters that are similar to character literals: plain characters, escape sequences, and universal characters. You can break a long line into multiple lines using string literals and separating the parts using whitespaces.

17
Q

Short

A

short 16-bit signed integer

18
Q

Float

A

float 32-bit Single-precision floating point type

19
Q

int

A

int 32-bit signed integer

20
Q

How does data type conversion work

A

Type conversion happens when we assign the value of one data type to another. If the data types are compatible, then C# does Automatic Type Conversion. If not comparable, then they need to be converted explicitly which is known as Explicit Type conversion. For example, assigning an int value to a long variable