C#

¡Supera tus tareas y exámenes ahora con Quizwiz!

What is the "using" statement in C#?

"Using" Keyword denotes that the particular namespace is being used by the program.

What is a race condition?

-it occurs when two threads access the same resource and are trying to change it at the same time.

what is a regular expression?

-template to match a set of input. The pattern can consist of operators, constructs or character literals. -Regex is used for string parsing and replacing the character string.

What is a constant variable?

-variables are declared and initialized at compile time -value cannot be changed aftet

What is a constructor?

-A constructor is a member function in a class that has the same name as its class. -The constructor is automatically invoked whenever an object class is created.

What is an abstract method?

-An abstract method does not have implementation. -They reside in an abstract class. -The derived class fills implements the abstract class.

Array vs ArrayList?

-Array fixed size and only one type -ArrayList is not fixed and only one type.

what is an Array Class?

-Base Class For All Arrays. -Provides properties and methods

basic string operations?

-Concatenate -Modify -Compare -Search

Pros to using an abstract class?

-If we add a new method to an abstract class then we have the option of providing default implementation and therefore all the existing code might work properly.

What is the difference between method overriding and method overloading?

-In method overriding, we change the method definition in the derived class that changes the method behavior. -Method overloading is creating a method with the same name within the same class having different signatures. (Base class must use abstract/virtual in the method definition)

What is polymorphism?

-It allows you to invoke methods of derived class through base class reference during runtime. -It has the ability for derived classes to provide different implementations of methods that are called through the same name. -In static polymorphism, the response to a function is determined at the compile time. (Function Overloading) -In dynamic polymorphism, it is decided at run-time. (Abstract Class Implementation) EXAMPLE: Animal Class Implements a Method called Sound(), and subclasses like Cat, Dog, Horse can override the method by implementing their own version of Sound(). The parent class can access the new implementation.

What is a Lock?

-Keyword that ensures one thread enters a particular section of code at a time -used with multithreading

What is Protected Access Specifier?

-Protected access specifier allows a child class to access the member variables and member functions of its base class.

What is reflection?

-The ability of a code to access information about objects, methods during run time.

What is a static method/variable?

-They are globally accessible without creating an instance of a class. -Static member are by default not globally accessible it depends upon the type of access modified used. -The compiler stores the address of the method as the entry point and uses this information to begin execution before any objects are created

What is an Asynchronous operation?

-Two or more operations are utilizing different threads, so all operations could run concurrently.

What is a Synchronous Operation?

-Two or more operations are utilizing the same thread, so when one operation is running, the others are blocked. -Operations are run sequentially

What is an Abstract Class?

-Used Only as a Base(Parent) class -Always be Inherited -Instance of class itself cannot be created -methods are not implemented -subclass override and provide implementations.

what is an array?

-Used to store multiple values of the same type. -stored in a contiguous memory location?

What is serialization?

-is a process of converting an object to a stream of bytes. -used to transport through a network -Once it is converted to bytes, it can be easily stored and written to a disk or any such storage devices.

What is a mutex?

-is also a type of lock that can work across multiple processes

what is a jagged array?

-is an array whose elements are arrays -array of arrays

What is a Deadlock?

A Deadlock is a situation where a process is not able to complete its execution because two or more processes are waiting for each other to finish. example: Resource A and resource B are used by process X and process Y X starts to use A. X and Y try to start using B Y 'wins' and gets B first now Y needs to use A A is locked by X, which is waiting for Y

what is a deconstructor?

A Destructor is used to clean up the memory and free the resources. Use: You don't want to wait at the end to free resource for a complex program.

What is a break statement?

Breaks the loop in which it is utilized.

What is a "catch" exception handler?

Catches the exception and allows the programmer to do an action for the exception.

Difference Between Class and Struct?

Class - Supports Inheritance - Pass by Reference - Members private by Default Struct -Does not Support Inheritance - Is Pass by Value -members public by Default

The four fundamental concepts of Object Oriented Programming are:

Encapsulation, Abstraction, Inheritance, Polymorphism

Cons to using an interface?

If we add a new method to an Interface then we have to track down all the implementations of the interface and define implementation for the new method.

Difference between Interface and Abstract Class?

Interface - is not a class -class can inherit multiple interfaces. -does not have access specifiers (default is public) -methods not implemented, derived class must implement Abstract -A class can only inherit one abstract class. -Can have non abstract methods that have implementations

What is Internal Access Specifier?

Internal access specifier allows a class to expose its member variables and member functions to other functions and objects in the current assembly.

What is a read-only variable?

Is used when we want to assign a value at run-time.

What is a "finally" exception handler?

It is a block of code written to execute regardless whether an exception is caught or not. -Will execute even if a return statement is hit. -contains clean up code.

What is abstraction?

It is a process of identifying the critical behavior and data of an object and eliminating the irrelevant details. EXAMPLE: if I say a table you have an idea of what I mean even though I didn't say if it was wood/glass or big/small. This is the essential idea behind creating classes.

What is an object?

It is an instance of a class.

What is inheritance?

It is the ability to create new classes from another class. It is done by accessing, modifying and extending the behavior of objects in the parent class. EXAMPLE: You have a Class Car that has two properties Size and Weight. Now you can create a new derived class Toyota. This class now has access to these base properties but also could implement new properties/methods.

What is Private Access Specifier?

Private access specifier allows a class to hide its member variables and member functions from other functions and objects.

What is Public Access Specifier?

Public access specifier allows a class to expose its member variables and member functions to other functions and objects.

What are the access specifiers?

Public, Private, Protected, Internal, Protecter Internal

What is a continue statement?

Skips Current Iteration and Goes to the Next.

What is encapsulation?

The Internal representation of an object is hidden from the view outside object's definition. Only the required information can be accessed whereas the rest of the data implementation is hidden. It can be implemented by using the Private Access Specifiers -Benefits: Data-Hiding, Reusability, Testing

What is Protected Internal Access Specifier?

The protected internal access specifier allows a class to hide its member variables and member functions from other class objects and functions, except a child class within the same application.

What is a Namespace

They are used to organize large code projects.

What is a "throw" exception handler?

Throws an exception when a problem occurs.

An interface is an entity that only includes method signatures. The methods are not implemented in the interface. Another class must be created to supply the implementation.

What is an Interface?

A Class is an encapsulation of properties and methods that are used to represent a real-time entity. It is a data structure that brings all the instances together in a single unit. public class Car {} An Object in an instance of a Class. Technically, it is just a block of memory allocated that can be stored in the form of Variables, Array or a Collection.

What is an Object and a Class?

How is exception Handling implemented in C#?

You use Try, Catch, Finally, Throw.

what are some examples of escape sequences?

\n - Newline character \b - Backspace \\ - Backslash \' - Single quote \'' - Double Quote

What is a virtual method?

a method with a default implementation. However, it can be overridden in a derived class. Use key word override.

what is an escape sequence?

an escape sequence is denoted by '\'.

What is a "try" exception handler?

contains block of code for which the exception will be checked.

What is an access specifiers?

defines the scope and visibility of a class member.

What are value types?

int, enum, byte, decimal, float, bool

Why use an interface?

interfaces in C# are a means to get around the lack of multiple inheritances in C#, meaning you cannot inherit from multiple classes but you can implement multiple interfaces.

Thread

is a set of instructions that can be executed, which will enable our program to perform concurrent processing.

what is deserialization?

is the process of converting the binary format to regular code

What is a string?

it is a collection of char objects

what is an XSD file?

stands for XML schema definition. It gives structure for the xml file.

What are reference types?

string, class, interface, object, collection

what is a sealed class?

we want to restrict the class from being inherited.


Conjuntos de estudio relacionados

GLB Capstone Midterm (Chapter 5)

View Set

Chapter 7: Regional Differences Test Questions

View Set

Part 1 of Lavaglia Sociology final

View Set