CastException

Summary

Represents a failed runtime type cast.

Description

Represents a failed runtime type cast.

Examples

Example of how this exception might be encountered
1
2
3
4
5
6
7
8
9
10
11
12
13
import System;
import System.Exceptions;
 
class Foo {}
class Bar : Foo {}
 
try {
    Foo foo = new Foo();
    (Bar) foo;
}
catch(CastException e) {
    Console.error(e);
}

Methods

Share

HTML | BBCode | Direct Link