摘要:
使用AutowireCapableBeanFactory手动注入 使用.newInstance();创建对象的话,如果其他对象都使用Spring Autowired,还需要手动创建所有依赖的Bean: private @Autowired AutowireCapableBeanFactory bea 阅读全文
摘要:
在java 8 Stream中,flatMap方法是一个维度升降的方法 举例说明 给 定 单 词 列 表[“Hello”,“World”] ,要返回列表 [“H”,“e”,“l”, “o”,“W”,“r”,“d”] 。 使用map方法,代码如下: public class StreamStr { p 阅读全文
摘要:
1.在项目所在文件夹根目录使用maven命令打包时: <!-- 不执行单元测试,也不编译测试类 --> mvn install -Dmaven.test.skip=true 或 <!-- 不执行单元测试,但会编译测试类,并在target/test-classes目录下生成相应的class --> m 阅读全文
摘要:
从一个最简单也最经典问题说起: 能说一说 System.out.println( 1f == 0.999999999999f );的打印结果是什么吗?这么写有什么问题吗? 对于这样一个问题,回答结果一般也就两种情况。 其实这个题目考察的目的简单而明确:**浮点数在计算机中是如何运算的?写代码时有什么 阅读全文
摘要:
Despite the common belief it is actually possible to access private fields and methods of other classes via Java Reflection. It is not even that diffi 阅读全文