Студопедия
Случайная страница | ТОМ-1 | ТОМ-2 | ТОМ-3
АрхитектураБиологияГеографияДругоеИностранные языки
ИнформатикаИсторияКультураЛитератураМатематика
МедицинаМеханикаОбразованиеОхрана трудаПедагогика
ПолитикаПравоПрограммированиеПсихологияРелигия
СоциологияСпортСтроительствоФизикаФилософия
ФинансыХимияЭкологияЭкономикаЭлектроника

Common Exception Classes

Database boolean type | Array initializers | Interface members | Interface member access | Fully qualified interface member names | Explicit interface member implementations | Interface mapping | Enum modifiers | The System.Enum type | Delegate declarations |


Читайте также:
  1. A SUMMARY OF EXCEPTIONS TO THE MIRANDA RULE
  2. A. Read the text and explain carefully whether you still share the common myths about the modern male.
  3. CHAPTER IV GRAMMATICAL CLASSES OF WORDS
  4. Chapter Three On Horsell Common
  5. Characterize the major political parties in the UK (Labour, Conservative and Liberal Democrats). The position of these parties in the House of Commons today.
  6. Classes 2 - 3. TYPOLOGY OF THE LEXICAL SYSTEMS
  7. Classes and objects

The following exceptions are thrown by certain C# operations.

 

System.ArithmeticException A base class for exceptions that occur during arithmetic operations, such as System.DivideByZeroException and System.OverflowException.
System.ArrayTypeMismatchException Thrown when a store into an array fails because the actual type of the stored element is incompatible with the actual type of the array.
System.DivideByZeroException Thrown when an attempt to divide an integral value by zero occurs.
System.IndexOutOfRangeException Thrown when an attempt to index an array via an index that is less than zero or outside the bounds of the array.
System.InvalidCastException Thrown when an explicit conversion from a base type or interface to a derived type fails at run time.
System.NullReferenceException Thrown when a null reference is used in a way that causes the referenced object to be required.
System.OutOfMemoryException Thrown when an attempt to allocate memory (via new) fails.
System.OverflowException Thrown when an arithmetic operation in a checked context overflows.
System.StackOverflowException Thrown when the execution stack is exhausted by having too many pending method calls; typically indicative of very deep or unbounded recursion.
System.TypeInitializationException Thrown when a static constructor throws an exception, and no catch clauses exists to catch it.

 


Attributes

Much of the C# language enables the programmer to specify declarative information about the entities defined in the program. For example, the accessibility of a method in a class is specified by decorating it with the method-modifiers public, protected, internal, and private.

C# enables programmers to invent new kinds of declarative information, called attributes. Programmers can then attach attributes to various program entities, and retrieve attribute information in a run-time environment. For instance, a framework might define a HelpAttribute attribute that can be placed on certain program elements (such as classes and methods) to provide a mapping from those program elements to their documentation.

Attributes are defined through the declaration of attribute classes (§17.1), which may have positional and named parameters (§17.1.2). Attributes are attached to entities in a C# program using attribute specifications (§17.2), and can be retrieved at run-time as attribute instances (§17.3).


Дата добавления: 2015-11-16; просмотров: 75 | Нарушение авторских прав


<== предыдущая страница | следующая страница ==>
Delegate invocation| Attribute usage

mybiblioteka.su - 2015-2024 год. (0.005 сек.)