Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
PrivateConstructorToCreateSingleObject
//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; namespace Rextester { public class Program { public static void Main(string[] args) { //Your code goes here ConstrctorClass constrctorClass1=ConstrctorClass.GetConstrctorClass(); ConstrctorClass constrctorClass2=ConstrctorClass.GetConstrctorClass(); ConstrctorClass constrctorClass3=ConstrctorClass.GetConstrctorClass(); Console.WriteLine("Hello, world!"); } } public class ConstrctorClass { public static ConstrctorClass _ConstrctorClass; public static ConstrctorClass GetConstrctorClass() { if(_ConstrctorClass==null) { _ConstrctorClass=new ConstrctorClass(); Console.WriteLine("New"); } else { Console.WriteLine("Old"); } return _ConstrctorClass; } private ConstrctorClass() { } } }
run
|
edit
|
history
|
help
0
Write a program to count the occurrence of each distinct item in the array?
Hello World!
23
I know it's a bit combersome, but it's my first attempt.
C# Basic learning
7.2 Creating async methods the old way
TEst1
3. Delegates and events, reference pitfall
insertion sort
Math 9.4