final类型的成员变量初始化值:
1、声明时候直接赋值
2、构造方法中赋值,如果一个类中有多个构造方法,就要保证在每个构造方法中都要完成对final类型变量的初始化工作
3、静态final成员变量必须在声明时赋值,且不能在构造方法中赋值
4、final成员变量指的是引用不能改变,即该变量的引用不能在指向其他的对象,但是对象的内容是可以改变的,比如stringbuffer可以通过append、remove等对该对象的内容作出改变。...
分类:
编程语言 时间:
2014-07-22 23:03:14
阅读次数:
348
1.卸载ibus输入法: sudo apt-get remove ibus
sudo为取得root权限的意思,Ubuntu系统默认root账户关闭,很多操作需要取得root 权限才可以进行
killall ibus-daemon
sudo apt-get purge ibus ibus-gtk ibus-gtk3 ibus-pinyin* ibus-sunpinyin i...
分类:
其他好文 时间:
2014-07-22 23:01:34
阅读次数:
312
题目和poj 上的一道题几乎一样。题意:已知n棵树距第一棵树的距离,求删掉m棵树后的 树之间
的最小距离 的最大值。思路:二分枚举最小的距离,注意二分的写法。 1 #include 2 #include 3 #include 4 #include 5
#include 6 #include...
分类:
其他好文 时间:
2014-07-22 22:59:15
阅读次数:
249
话不多说,直接上代码:sudo apt-get remove ibussudo apt-get
install fcitx fcitx-config-gtk im-switchsudo dpkg -i *.debsudo apt-get -f
installsudo dpkg -i *.debsud...
分类:
其他好文 时间:
2014-05-06 01:11:53
阅读次数:
269
遇到的问题:input{1,1,1}, output{1,1}, expected{1},
原因在于若temp.val==temp.next.val, 则需要temp.next=temp.next.next,
这时候就不要temp=temp.next了注意停止条件不光是temp!=null,还应该有...
分类:
其他好文 时间:
2014-05-05 22:47:08
阅读次数:
454
题目:
Given an array and a value, remove all instances of that value in place and return the new length.
The order of elements can be changed. It doesn't matter what you leave beyond the new len...
分类:
其他好文 时间:
2014-05-05 12:58:57
阅读次数:
294
一次性通过的,比较顺利,从读题到编写到检查到通过,14分50秒,我在不断进步中,相信经过一段时间联系,这种题可以一眼就写出来,不超过5分钟。这道题应该说方法跟
Remove Duplicates from sorted Array挺类似的My Solution: 1 public class Sol...
分类:
其他好文 时间:
2014-05-02 12:56:10
阅读次数:
260
没有想通为什么这个简单的问题竟然不是那么简单,太小看它了,以下是两个别人的很不错的solution:Solution1:
1 public class Solution { 2 public int removeDuplicates(int[] A) { 3 // Start...
分类:
其他好文 时间:
2014-05-01 20:19:26
阅读次数:
384
对于vector容器的使用,平时只是简单的进行遍历查找一下,未曾进行其它操作,这不,今天出了一点差错;
earse方法的操作是将此时的节点删除,然后指向被删除节点的下一个:
如对数据1 6 6 4 7;...
分类:
其他好文 时间:
2014-05-01 18:47:34
阅读次数:
501
org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.NEVER) - turn your Session into FlushMode.AUTO or remove 'readOnly' marker from transaction definition...
分类:
数据库 时间:
2014-05-01 18:16:35
阅读次数:
377