Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Namespaces multiple
//Title of this code //Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using Example.NameSpaceExample; using NameSpaceExample2; namespace Example { namespace NameSpaceExample { class CountDown { int val; public CountDown(int n) { val = n; } public void Reset(int n) { val = n; } public int Count() { if(val > 0) return val--; else return 0; } } } } namespace NameSpaceExample2 { class CountDown { int val; public CountDown(int n) { val = n; } public void Reset(int n) { val = n; } public int Count() { if(val > 0) return val--; else return 0; } } } namespace Rextester { public class Program { public static void Main(string[] args) { // Notice how CountDown is qualified by Counter. //NameSpaceExample.CountDown cd1 = new NameSpaceExample.CountDown(10); Example.NameSpaceExample.CountDown cd1=new Example.NameSpaceExample.CountDown(10); int i; do { i = cd1.Count(); Console.Write(i + " "); } while(i > 0); Console.WriteLine(); // Again, notice how CountDown is qualified by Counter. Example.NameSpaceExample.CountDown cd2 = new Example.NameSpaceExample.CountDown(20); do { i = cd2.Count(); Console.Write(i + " "); } while(i > 0); Console.WriteLine(); cd2.Reset(4); do { i = cd2.Count(); Console.Write(i + " "); } while(i > 0); Console.WriteLine(); } } }
run
|
edit
|
history
|
help
0
EDFCSCSA V
sxsadxasxd
sdfghyjuyhtgrfedc
sdfghjkikujyhtgrfedw
Demonstration await Control returned to the Caller
Intuit // C# // listing_4.9 (do_while // kupi_slonika
The modifier 'private' is not valid for this item
test
sum of two array elements
1. soru