代码搜索:singleton
找到约 4,696 项符合「singleton」的源代码
代码结果 4,696
www.eeworm.com/read/164604/5489005
java singleton.java
package headfirst.singleton.stat;
public class Singleton {
private static Singleton uniqueInstance = new Singleton();
private Singleton() {}
public static Singleton getInstance() {
return un
www.eeworm.com/read/164604/5489007
java singleton.java
package headfirst.singleton.threadsafe;
public class Singleton {
private static Singleton uniqueInstance;
// other useful instance variables here
private Singleton() {}
public static synchr
www.eeworm.com/read/164604/5489008
java singleton.java
package headfirst.singleton.classic;
// NOTE: This is not thread safe!
public class Singleton {
private static Singleton uniqueInstance;
// other useful instance variables here
private Single
www.eeworm.com/read/162614/5520046
c singleton.c
// { dg-do run }
// This tests two things:
// 1. there is an annoying warning.
// singleton.C:26: warning: `class singleton' only defines private constructors and has no friends
// egcs fails to see
www.eeworm.com/read/343156/3223976
h singleton.h
/* Copyright (C) Steve Rabin, 2001.
* All rights reserved worldwide.
*
* This software is provided "as is" without express or implied
* warranties. You may freely copy and compile this source
www.eeworm.com/read/340665/3274041
c singleton.c
// This tests two things:
// 1. there is an annoying warning.
// singleton.C:26: warning: `class singleton' only defines private constructors and has no friends
// egcs fails to see that there is a pu
www.eeworm.com/read/336871/3346267
java singleton.java
package com.hygj.test;
public class Singleton {
//声明静态变量代表要返回的实例对象
private static Singleton instance=null;
private int age;
/**
* 构造函数私有化 *
*/
private Singleton() {
System.out.p
www.eeworm.com/read/336126/3353914
java singleton.java
public class Singleton
{
public static void main(String[] args)
{
A a1,a2;
a1=A.getInstance();
a2=A.getInstance();
System.out.println(a1==a2);
}
}
class A
{
private stati
www.eeworm.com/read/293655/3929293
java singleton.java
/*
* 项目名称 Pattern
* 包名称 com.niufish.pattern.singleton
*
* 文件名称 Singleton.java
*
*/
package com.niufish.pattern.singleton;
/**
* 线程安全的单例
*
*
www.eeworm.com/read/269040/4247846
java singleton.java
package org.gof.create.singleton;
/**
* Title: 单例模式
* Description: 单例模式范例
* Copyright: Copyright (c) 2007
* @author by lbj
* @version 1.0
*/
public class Singlet