C# Terms: Keywords

Home > Preview

The flashcards below were created by user geschw66 on FreezingBlue Flashcards.


  1. abstract keyword (def'n)
    Keyword modifier indicates that the thing being modified has a missing or incomplete implementation. used with base class, kind of like virtual in C++. Also, no implementation of functions.
  2. async (def'n)
    Use this keyword modifier to specify that a method, lambda expression, or anonymous method is asynchronous. Using threading
  3. as (def'n)
    You can use the keyword operator to perform certain types of conversions between compatible reference types or nullable types. Think dynamic binding.
  4. const (def'n)
    You use this keyword to declare a constant field or a constant local. Constant fields and locals aren't variables and may not be modified.
  5. event (def'n)
    This keyword is used to declare an event in a publisher class. Think listener, handler etc.
  6. extern (def'n)
    This keyword modifier is used to declare a method that is implemented externally.
  7. override (def'n)
    This keyword modifier is required to extend or modify the abstract or virtual implementation of an inherited method,property, indexer, or event.
  8. readonly  (def'n)
    This keyword is a modifier that you can use on fields.
  9. What is the difference between the readonly keyword and the const keyword?
    The readonly keyword is different from the const keyword. A const field can only be initialized at the declaration of the field. A readonly field can be initialized either at the declaration or in a constructor. Therefore, readonly fields can have different values depending on the constructor used. Also, while a const field is a compile-time constant, the readonly field can be used for run-time constants.
  10. When might you use the readonly keyword?
    when you have a field, that you dont want changed but it is origin comes from outside the code or language. An example is a timestamp:


    public static readonly uint timeStamp = (uint)DateTime.Now.Ticks;


    In the above example we are garnering the value during run-time NOT compile-time. The time stamp may be different depending upon when during run-time it is initialized.
  11. sealed (def'n)
    When applied to a class, this keyword modifier prevents other classes from inheriting from it.
  12. static (def'n)
    Use this keyword modifier to declare a static member, which belongs to the type itself rather than to a specific object.
  13. unsafe (def'n)
    This keyword denotes an unsafe context, which is required for any operation involving pointers.
  14. virtual (def'n)
    This keyword is used to modify a method, property, indexer, or event declaration and allow for it to be overridden in a derived class.

    Different than the abstract keyword, because the implementation is defined for the base class.
  15. volatile (def'n)
    This keyword indicates that a field might be modified by multiple threads that are executing at the same time.
  16. void (def'n)
    When this keyword is used as the return type for a method, it specifies that the method doesn't return a value.
  17. var (def'n)
    this keyword when used in place of a type name for variables that are declared at method scope can have an implicit "type".


    An implicitly typed local variable is strongly typed just as if you had declared the type yourself, but the compiler determines the type.
  18. do (def'n)
    This keyword used in a loop, and has a while keyword in conjunction with it where the expression is evaluated. This keyword statement executes a statement or a block of statements repeatedly until a specified expression evaluates to false.
  19. do-while loop (def'n)
    Use this type of loop when you want a statement  or statements to execute at least oncethen get evaluated for another iteration until the containing expression at the end is false.
  20. for (def'n)
    This keyword is part of a kind of loop that is useful for iterating over arrays and for other applications in which you know in advance how many times you want the loop to iterate.
  21. foreach (def'n)
    This keyword is part of a statement repeats a group of embedded statements for each element in an array or an object collection that implements the System.Collections.IEnumerable or System.Collections.Generic.IEnumerable<T> interface.

    You may only get a value from the collection, and not add,  or delete it, as it might give unexpected behavior.
  22. Public (access modifiers) (def'n)
    This access modifier is the most permissive access level. There are no restrictions on accessing members with this access level.
  23. Protected (access modifiers) (def'n)
    This access modifier is accessible within its class and by derived class instances.
  24. Private (access modifiers) (def'n)
    This access modifier is the least permissive access level(modifier). This access modifier's members are accessible only within the body of the class or the struct in which they are declared.

    in other words:these members are only accessible within their own type.
  25. Internal (access modifier) (def'n)
    This access modifier can be accessed from the current assembly only.
  26. Protected Internal (access modifier) (def'n)
    This access modifier can be accessed from the current assembly or from types that are derived from the containing class outside the assembly.
  27. assembly  (in C#) (def'n)
    This is a file that is automatically generated by the compiler upon successful compilation of every .NET application. It can be either a Dynamic Link Library (.dll) or an Executable file (exe).
  28. method (def'n)
    A group of statements that perform a task.
  29. main(string [] args) (def'n)
    Every C# program has one of these methods, that in ASP .NET Core lives in the public class Program.cs

    Additionally
    it is the entry-point of the program to associate web hosting builder ...are we going to use Kestral?, or IISIntegration?
  30. Kestrel (def'n)
    This is a cross-platform web server for ASP.NET Core based on libuv,a cross-platform asynchronous I/O library.additionally it is the web server that is included by default in ASP.NET Core project templates.
  31. Array (def'n)
    This is used to store a collection of data, but it is often more useful to think of it as a collection of variables of the same type stored at contiguous memory locations.
  32. Interface (def'n)
    A syntactical contract that all the classes inheriting it should follow.


    • This  syntactical contract defines the "WHAT" part.
    • The derived classes define the "HOW" part (Implementation) of the syntactical contract.
  33. ADO.NET (def'n)
    This is the primary data access API for the .Net Framework
  34. Common Language Runtime(CLR) (def'n)
    • The virtual machine component of Microsoft's .NET framework
    • Manages the execution of .NET programs.

Card Set Information

Author:
geschw66
ID:
334069
Filename:
C# Terms: Keywords
Updated:
2017-11-28 21:40:35
Tags:
Programming Language Keywords
Folders:

Description:
C# keywords and short definition
Show Answers:

Home > Flashcards > Print Preview