/*匿名对象:没有名字的对象匿名对象的使用方式之一:当对对象方法只调用一次时,我们可以用匿名对象来完成,比较简化。匿名对象的使用方式之二:匿名对象可以被当做实参传递*/class Car{ String color; void start(){ System.out.pri...
分类:
编程语言 时间:
2015-05-31 21:30:56
阅读次数:
333
Given an array of integers and an integerk, find out whether there there are two distinct indicesiandjin the array such thatnums[i] = nums[j]and the d...
分类:
其他好文 时间:
2015-05-31 15:20:01
阅读次数:
88
生产者消费者问题问题描述是:有一群生产者进程在生产产品,此产品提供给消费者去消费。为使生产者和消费者进程能并发执行,在它们之间设置一个具有n个缓冲池,生产者进程可将它所生产的产品放入一个缓冲池中,消费者进程可从一个缓冲区取得一个产品消费。利用记录型信号量semaphore mutex=1,empty=n,full=0;
item buffer[n]; //缓冲区
int in=out=0;...
分类:
系统相关 时间:
2015-05-31 14:03:38
阅读次数:
201
当您在计算Money的时候,请看好了!!!要不损失了别后悔!!!现象1: public static void main(String[] args) { System.out.println(0.030*100);//输出3.0 System.out.println(0.031*100);//输出...
分类:
编程语言 时间:
2015-05-31 13:40:01
阅读次数:
134
If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total.
If all the numbers from 1 to 1000 (one thousand) inclusive we...
分类:
其他好文 时间:
2015-05-31 12:33:14
阅读次数:
126
Given an array of integers and an integer k, find out whether there there are two distinct indices i and j in the array such that nums[i] = nums[j] and the difference between iand j is at most k.思路分析:...
分类:
其他好文 时间:
2015-05-31 12:26:41
阅读次数:
87
Contain Duplicate II:Given an array of integers and an integerk, find out whether there there are two distinct indicesiandjin the array such thatnums[...
分类:
其他好文 时间:
2015-05-31 12:13:16
阅读次数:
106
一个源文件多个类
一个java源文件中是否可以包含多个类(不是内部类)?有什么限制?
答:可以有多个类,但只能有一个public的类,并且public的类名补习与文件名相一致。
示例代码如下:
public class Test1 {
private Integer id;
public void print(){
System.out.println("id="+id...
分类:
编程语言 时间:
2015-05-31 09:35:34
阅读次数:
196
简单记录几点,以备后忘:1、python中的默认编码方式为asciiIn[1]:importsys
In[2]:sys.getdefaultencoding()
Out[2]:‘ascii‘2、设置python中的默认编码方式In[1]:importsys
In[2]:reload(sys)
<module‘sys‘(built-in)>
In[3]:sys.setdefaultencoding(‘utf-8‘)
In[4]:sys..
分类:
编程语言 时间:
2015-05-31 06:57:41
阅读次数:
201
简单记录几点,以备后忘:1、python中的默认编码方式为asciiIn[1]:importsys
In[2]:sys.getdefaultencoding()
Out[2]:‘ascii‘2、设置python中的默认编码方式In[1]:importsys
In[2]:reload(sys)
<module‘sys‘(built-in)>
In[3]:sys.setdefaultencoding(‘utf-8‘)
In[4]:sys..
分类:
编程语言 时间:
2015-05-31 06:56:14
阅读次数:
147