摘要: 一、验证结论: 如果对象由注解注入则对象初始化时只是简单的调用空构造函数,属性则为默认值 如果为new()对象,赋值是什么就是什么 package com.gxb.crawler.contoller; import org.springframework.stereotype.Component; 阅读全文
posted @ 2021-01-11 16:50 我怎么这么好看 阅读(2568) 评论(0) 推荐(0) 编辑
摘要: 首先给出要验证的结论: 一、当有static修饰的静态代码时 父类静态代码块(同类内static修饰的属性按顺序执行)>子类静态代码块(同类内static修饰的成员按顺序执行)>父类属性、代码块(按声明顺序执行) >父类构造器> 子类属性、代码块(按声明顺序执行)>子类构造器 二、当没有static 阅读全文
posted @ 2021-01-11 15:28 我怎么这么好看 阅读(90) 评论(0) 推荐(0) 编辑
摘要: 从0.7.1版本开始,WebMagic开始使用了新的代理APIProxyProvider。因为相对于Site的“配置”,ProxyProvider定位更多是一个“组件”,所以代理不再从Site设置,而是由HttpClientDownloader设置 API说明 HttpClientDownloade 阅读全文
posted @ 2021-01-01 11:06 我怎么这么好看 阅读(642) 评论(0) 推荐(0) 编辑
摘要: maven工程: log4j.properties log4j.rootLogger=DEBUG,A1 log4j.logger.org.example=DEBUG log4j.appender.A1=org.apache.log4j.ConsoleAppender log4j.appender.A 阅读全文
posted @ 2020-12-31 23:06 我怎么这么好看 阅读(81) 评论(0) 推荐(0) 编辑
摘要: webmagic学习介绍:http://webmagic.io/docs/zh/ webmagic学习视频:https://www.bilibili.com/video/BV1cE411u7RA 一、maven工程 log4j.porperties log4j.rootLogger=INFO,A1 阅读全文
posted @ 2020-12-31 22:49 我怎么这么好看 阅读(185) 评论(0) 推荐(0) 编辑
摘要: simhash项目地址:https://github.com/CreekLou/simhash.git 这个项目不能直接使用,得改造,一般需要改造两个地方: 1、luecene的核心jar包版本与其他包及分词器ikanalyzer中使用的版本不一致,注意检查 此项目将核心包版本从3.6.1改为4.7 阅读全文
posted @ 2020-12-31 22:41 我怎么这么好看 阅读(296) 评论(0) 推荐(0) 编辑
摘要: 举一个例子其他雷同: int Integer String 一、int,String 转Integer(定义时) Integer a=new Integer(int value); Integer a=new Integer(String value); 二、String 转Integer Inte 阅读全文
posted @ 2020-12-31 22:18 我怎么这么好看 阅读(49) 评论(0) 推荐(0) 编辑
摘要: 1. forEach and Map普通方式遍历 Map Map<String, Integer> items = new HashMap<>(); items.put("A", 10); items.put("B", 20); items.put("C", 30); items.put("D", 阅读全文
posted @ 2020-12-31 22:03 我怎么这么好看 阅读(57) 评论(0) 推荐(0) 编辑
摘要: 一、基于基本数据类型的变量创建的数组: byte short int long double float char boolean 对于基本数据类型为: byte short int long 初始化为 0 对于基本数据类型为: double float 默认的为 0.0 boolean 对于基本数 阅读全文
posted @ 2020-12-31 22:00 我怎么这么好看 阅读(265) 评论(0) 推荐(0) 编辑
摘要: 1、String abc=null,声明了一个字符串对象的空引用,在栈内创建了栈帧或句柄,未在堆内存内分配空间; 2、String abc="",声明了一个空字符串对象,初始化栈内分配了内存,指向常量池空字符串地址; 3、String abc,声明了字符串对象,但为分配内存。作为成员变量时程序运行会 阅读全文
posted @ 2020-12-29 10:17 我怎么这么好看 阅读(107) 评论(0) 推荐(0) 编辑