using System;
class ClassA
{
public static void Main()
{
Console.WriteLine("Class A");
}
}
class ClassB
{
public static void Main()
{
Console.WriteLine("Class B");
}
}
save this file as abc.cs
and compile with csc abc.cs/main:classA if you choose classA as entry point
and compile with csc abc.cs/main:classB if you choose classB as entry point
Be Different with excellent knowledge A Devloper Blog....
Subscribe to:
Post Comments (Atom)
-
Make Your Own Notepad In this tutorial we will be making a simple C# Notepad with the option to Clear, Cut, Copy, Paste, Select All, Save...
just add a keyword 'public' to one of your classes and then check the result for yourself.
ReplyDeleteExample: public class ClassA{//rest all code same.
Please also check to see if you place the 'public' in front of both the class declarations you will get a compile time error. I hope it will help you.