Snippet Type(s): Expansion
Abstract (from author):
we all aware of Singleton class and very frequently we are using in our projects.This custom snippet helps to define a Singletone class.
Description (from snippet):
Code snippet for define singleton class
Code Block:
1 class $classname$
2 {
3 static private $classname$ $field$ = null;
4
5 protected $classname$()
6 {
7
8 }
9 public static $classname$ $method$()
10 {
11
12 if ($field$ == null)
13 $field$ = new $classname$();
14
15 return $field$;
16 }
17 }
Download Now!
Download the snippet file by clicking the download button below. You may customize the snippet shortcut prior to downloading below.