The singleton is a useful design pattern for allowing only one instance of your class, but common mistakes can inadvertently allow more than one instance to be created.
单例模式是一种非常有用的设计模式,它允许你的类对外只提供一个实例,但是常犯的错误在于不止一个实例被创建。
Notice what our code has so far: first, our Account class isn't a bean (it essentially has a getter -- but no setter -- for its one data member).
注意一下目前我们的代码有哪些东西:首先,我们的Account类不是一个bean (实际上,对于它的一个数据成员它有一个getter方法――但是没有setter 方法)。
Xanax is one of a class of drugs known colloquially as "benzos" (benzodiazepines) that are safe and highly effective - but can also be addictive and have potential for abuse.
阿普唑仑是一类俗称“苯二氮平”的药物。这类药物安全有效,但是也可能让人上瘾并被滥用。
Nigeria is the world's biggest market for private generators; many middle-class homes have one, but small businesses can rarely afford them.
尼日利亚是世界最大的私人发电机市场,许多中产阶级家庭都拥有一部发电机,然而小商业者却很少能够负担得起相关的费用。
We could again use XSL to do this, but instead we will create one last method for merging XML files in our XMLHelper class.
我们本来可以再次使用XSL 执行,但我们将为 把 XSL文件合并到 XMLHelper类中最后创建一个方法。
Living standards have risen sharply for many middle-class Indians, but one-third of the population — well over 300 million people — live on less than one dollar a day.
印度许多中产阶级的生活水平显著提高,但是印度三分之一的人口,也就是3亿多人每天的生活费还不到1美元。
As for her sociology lecture class with 300 students, she says, "That class is really popular, but I haven't learned one thing."
而在社会学课上,300位同学一起上课,虽然课很受欢迎,但她却什么都没学到。
It's not just tuition fees, it's living cost as well, unaffordable for our middle-class state, but look, we have no one to talk it to them.
不只是学费问题,对于中产阶级来说,生活开支马上也成问题了,但是,看啊,根本没人去跟他们讨论这个问题。
For many dogs, a group class is fine, but some dogs train better in a one-on-one environment.
许多狗狗可以接受团体教学,但也有些狗要在一对一的环境下才能达到较好的训练效果。
But when at the railway station in Chaochow I asked for one second-class ticket for Swatow and they gave me two third-class tickets, I gave up and explained things in Cantonese.
可是我到潮州火车站去买一张到汕头的二等票时,他们却给了我两张三等票,我只好不说潮州话而用广州话跟他解释了。
Imagine that you want to use a class of a particular name, but more than one definition for that class exists (presumably these are different definitions).
假设我们想使用一个具有特定名称的类,但那个类的定义位于多个文件里。
"Now, class, " says the teacher, "who said, 'I only regret that I have but one life to give for my country'?"
“好的,同学们。”老师说,“‘我唯一遗憾的是我只有一次生命来献给我的祖国’这句话出自谁口?”
For one term, we learned the class, the teacher always put "originality" in the top position, but "how to", the teacher never talked it.
广告学:一学期,老师一直在强调广告要有创意,但是没说如何有创意。
In life, we care for mutually, in class, its music melts , though, is acquainted only for one year but kiss if brothers are attached to each other like brothers.
在生活中我们互相关心,班中其乐熔融,虽然只相识一年但却亲如兄弟情同手足。
BMW is best known for luxury 1 sedans and sports cars of course but there's one car in its stable that's in a class by itself.
宝马以豪华轿车和跑车著称,而旗下有一个车系却独树一帜。
BMW is best known for luxury 1 sedans and sports cars of course but there's one car in its stable that's in a class by itself.
宝马以豪华轿车和跑车著称,而旗下有一个车系却独树一帜。
应用推荐