Хабр Курсы для всех
РЕКЛАМА
Практикум, Хекслет, SkyPro, авторские курсы — собрали всех и попросили скидки. Осталось выбрать!
using System;
class Y
{
public Y()
{
Console.Write("0");
}
}
class X
{
private X(string s)
{
Console.Write(s);
}
public X() : this("_")
{
Console.Write("o");
}
Y y = new Y();
}
class App
{
static void Main()
{
X x = new X();
}
}
* This source code was highlighted with Source Code Highlighter.using System;
class Y
{
public Y()
{
Console.Write("0");
}
}
class Z
{
public Z()
{
Console.Write("_");
}
}
class X : Z
{
public X()
{
Console.Write("o");
}
Y y = new Y();
}
class App
{
static void Main()
{
X x = new X();
}
}
* This source code was highlighted with Source Code Highlighter.using System;
using System.Threading;
using System.IO;
class Y
{
public Y()
{
Console.Write("0");
}
}
class X
{
public X()
{
Console.Write("o");
}
Y y = new Y();
}
class App
{
public class CustomWriter : TextWriter
{
private TextWriter c = null;
public CustomWriter()
{
c = Console.Out;
Console.SetOut(this);
}
public override System.Text.Encoding Encoding
{
get { return c.Encoding; }
}
public override void Write(object value)
{
c.Write(value);
}
public override void Write(string value)
{
c.Write(value);
if (value == "0")
c.Write("_");
}
}
static App()
{
Console.SetOut(new CustomWriter());
}
static void Main()
{
X x = new X();
Console.ReadLine();
}
}
* This source code was highlighted with Source Code Highlighter.class Test
{
public Test() { throw new ApplicationException(); }
}
class App
{
static void Main()
{
try
{
new Test();
}
catch (Exception ex)
{
Console.WriteLine(ex.GetType().FullName);
}
Console.ReadLine();
}
}
* This source code was highlighted with Source Code Highlighter.class Test
{
static Test() { throw new ApplicationException(); }
}
class App
{
static void Main()
{
Test test = new Test();
}
}
* This source code was highlighted with Source Code Highlighter. class Y {
public Y() {
Console.Write("0");
}
}
class X {
public X() {
Console.Write("o");
}
Y y = new Y();
}
class Z {
~Z() {
Console.Write("\r0_o");
}
}
class App {
static void Main() {
X x = new X();
}
static Z z = new Z();
}
* This source code was highlighted with Source Code Highlighter.
C#: Этюды, часть 2