Web Log di Adrian Florea

"You know you've achieved perfection in design, not when you have nothing more to add, but when you have nothing more to take away." Antoine de Saint-Exupery
posts - 440, comments - 2715, trackbacks - 3944

My Links

Archives

Post Categories

Image Galleries

.RO Blogs

.RO People

.RO Sites

Blogs

Furls

Links

vinCitori

Quiz #67 [triple wrapping exceptions]

Senza utilizzare alcun throw, completate il seguente snippet in tal modo che il catch stampi Ciao! a console e tutte e tre le inner exception devono essere di tipi diversi:

using System;

class Quiz {
    // ... da completare

    static void Main() {
        try {
            // ... da completare
        }
        catch (Exception e) {
            if(e.InnerException != null && e.InnerException.InnerException != null && e.InnerException.InnerException.InnerException != null) {
                Console.WriteLine("Ciao!");
            }
        }
    }
}

Print | posted on domenica 4 novembre 2007 00:42 | Filed Under [ Quiz Sharp ]

Powered by:
Powered By Subtext Powered By ASP.NET