`
guojch
  • 浏览: 68492 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论
文章列表
答案其实很简单,都是非常基础的东西,但是平时可能不太在意这些细节,在找的时候也有可能不太确定(对我来说)。 答案如下: import java.util.ArrayList; import java.util.Collection; import java.util.List; import org.junit.Test; public class GenericTest { static class Person { public void m(Collection<Person> persons) { } } ...
Java基础: 下面的类里有几处错误? 不通过工具,你能很快的找出来吗?试一下吧! import java.util.ArrayList; import java.util.Collection; import java.util.List; import org.junit.Test; public class Test { static class Person { public void m(Collection<Person> persons) { } } static class Employee ...
转自:http://blog.csdn.net/zhanngle/article/details/2063490 ajax乱码解决总结 第一,javascript沿用java的字符处理方式,内部是使用unicode来处理所有字符的, 第二,utf-8是每个汉字(unicode字符)用3个字节来存储。 第三,用utf-8来send数据是不会出现乱码的,是后台程序没有正确解码才会出现乱码。 第四,ajax发送数据的时候如果修改 Content-Type 为 application/x-www-form-urlencoded",肯定是用post方式,而“太大的数据往往会出错”是用GET方式发 ...
一篇很好的介绍Java单例模式实现方式的文章。 转自:http://howtodoinjava.com/2012/10/22/singleton-design-pattern-in-java/ Singleton pattern is a design solution where an application wants to have one and only one instance of any class, in all possible scenarios without any exceptional condition. It has been debated long en ...
信用卡校验位算法THE LUHN MOD-10 http://blogread.cn/it/article/6324?f=wb import org.apache.commons.lang3.StringUtils; public class CreditCardValidator { /** * 1. 对卡号上的每位数字乘以权重。其规则是,如果卡号数字个数是偶数,则第一位乘以2,否则就乘以1,然后以后分别是,1,2,1,2,1,2; * * 2. 如果每位数字乘以权重后超过9 ,则需要减去 9; * * 3. 将所有的处理过的加权数字求 ...
  1.4之前不支持,1.5开始支持使用Volatile标记的变量。 Effective Java: 引用 Item 71: Use lazy initialization judiciously Lazy initialization is the act of delaying the initialization of a field until its value is needed. If the value is never needed, the field is never initialized. This technique is applicable to both st ...
备忘:     xbean-spring-2.8 不支持spring3.1,只支持到spring3.0,如果用到3.1版本需要升级到xbean-spring-3.6。
问题描述:         数据库:数据库编码:UTF-8,表编码UTF-8,问题字段编码UTF-8,字段类型blob,存储的为字符串经过compress后的内容,取的时候用uncompress解压缩 工程环境编码:UTF-8,编译好的class编码 UTF-8 连接中不管加不加useUnicode=true&characterEncoding=UTF-8,rs.getString()取出来的都含有乱码,比如其中的“with Janessa Paré”会变为“----with Janessa Par��”。 初步怀疑是压缩与解压缩的时候数据库内部对字符编码进行过处理,以至于出现乱码 ...
博客上看到的一篇文章,挺有意思的,有兴趣的可以看一下。 http://martinvalasek.com/blog/pictures-from-a-developers-life
转自: http://www.infoq.com/cn/news/2013/02/howto-strong-developer Aaron Stannard是新创公司MarkedUp的CEO,他最近花费大量时间雇佣、评估很多不同的程序员,并和他们一起协作。在这个过程中他发现并总结了十种程序员无法意识到自己潜力的原 ...
工作中配合Google Guice的使用,用到了Reflections工具包,记录一下,备忘。 项目地址:http://code.google.com/p/reflections/ 从官方文档上,我们可以了解到它是一个用于Java运行时元数据分析,本着注解搜寻的精神。 用途: Reflections scans your classpath, indexes the metadata, allows you to query it on runtime and may save and collect that information for many modules within yo ...
今天MyEclipse启动时报如下错误: !SESSION 2012-02-12 11:32:55.198 ----------------------------------------------- eclipse.buildId=unknown java.version=1.6.0_13 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=zh_CN Command-line arguments: -os win32 -ws win32 -arch ...
因为需要修改一个已存在的表的不允许为Null的列改为可为Null,网上查到的 ALTER TABLE table1 ALTER COLUMN [name] varchar(60) NULL; 不适用于Oracle,Oracle应该使用如下形式: ALTER TABLE TABLENAME MODIFY COLUMNNAME COLUMNTYPE NULL; TABLENAME:表名 COLUMNNAME:字段名 COLUMNTYPE:字段类型
public calss Point { private Double xPoint; private Double yPoint; getter and setter .... public static void main(String... args) { Point p = new Point(); p.setXPoint(12.3); PropertyUtils.getProperty(p, "xPoint"); } } 报错 Exception in thread &quo ...
   Struts2.1.8中的<sx:autocompleter>标签当使用中文的时候,输入时不能触发中文提示,当然可以按向下的方向键“↓”,也可以出来。但是这不是我想要的效果。     网上查了一些资料,多为2.0或者2.1.6版本的,跟2.1.8有区别,不能按其所说的修改了。于是自己参考了一下找到了解决办法:修改struts2-dojo-plugin-2.1.8.jar中org\apache\struts2\static\dojo\src\widget\ComboBox.js文件,如下 找到 _handleKeyEvents:function (evt) { if (e ...
Global site tag (gtag.js) - Google Analytics