MySQL2059错误
mysql8和之前的加密规则发生改变
java.lang.NoSuchMethodException: org.apache.catalina.deploy.WebXml addFilter
java.lang.NoSuchMethodException: org.apache.catalina.deploy.WebXml addFilter at org.apache.tomcat.util.IntrospectionUtils.callMethod1(IntrospectionUtils.java:855) at org.apache.tomcat.util.digester.SetNextRule.end(SetNextRule.java:201) ...
final修饰的Map List可以更改内部的值
public static void main(String[] args) { final Integer integer = new Integer(1); //integer = 2; //报错:无法为最终变量integer分配值; &...
Random和Math.random()简单总结
Random作为一个类,nextInt是它的方法,可以通过设置nextInt方法的参数限定产生随机数的范围,例如这样: System.out.println(random.nextInt(100)); 这样可以产生一个大于0小于100的随机整数。Math.random()是一个方法,它的作用是产生一个在0和1之间...
测试POI的formula方法
点击(此处)折叠或打开public static void formula() throws Exception{ Workbook workbook = new HSSFWorkbook(); Sheet sheet = workbook.createSheet("formula...
POI常用方法
点击(此处)折叠或打开public static void main(String[] args) throws IOException { Workbook workbook = new HSSFWorkbook(); /*==========获取常用对象======...
java实现将excel表格数据解析成JSONArray
程序主体:点击(此处)折叠或打开/*json头模板*/ public static final int HEADER_VALUE_TYPE_O = 1; /*实例*/ public static ExcelT...
json数组导出到Excel
导出方法点击(此处)折叠或打开public static JSONObject createExcel(String src, JSONArray json) { //用于返回响应的消息 JSONObject result = new JSONObj...
"javax.servlet.http.HttpServlet" was not found on the Java Build Path
原来Javaweb工程类中没有添加Tomcat运行时相关类导致。2、切换到Java Build Path界面中的Orader and Export,选择Tomcat。注意:
Got fatal error 1236 from master when reading data from binary log
Got fatal error 1236 from master when reading data from binary log: 'Slave can not handle replication events with the checksum that master is configured to log; the first event 'mysqlbin.000031' at 120, the last event read from 'D:\mysql-5.6.17-winx64\mysql-5.6.17-winx64\data\mysqlbin.000031' at 120...
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'原因:mysql数据库的user表里,存在用户名为空的账户即匿名账户,导致登录的时候是虽然用的是root,但实际是匿名登录的解决方法:在MySQL的配置文件的【mysqld】下加一行skip-grant-tables即可,然后重启MySQL服务,就可以不通过密码登...
为什么java不推荐使用vector
从网上各处搜集的知识整理出来1.因为vector是线程安全的,所以效率低,这容易理解,类似StringBuffer2.Vector空间满了之后,扩容是一倍,而ArrayList仅仅是一半3.Vector分配内存的时候需要连续的存储空间,如果数据太多,容易分配内存失败4.只能在尾部进行插入和删除操作,效率低...
String、StringBuffer与StringBuilder之间区别
1.执行速度:StringBuilder > StringBuffer > String 2. String
为什么在static方法中不能有this,也不能有super
因为static方法和类的实例(对象)是两码事,它只在类装载的时候(即编译的时候或者javac命令的时候)初始化,被称作类级变量(属于类);而类的实例是在程序运行的时候(即Java命令的时候)初始化,被称作对象级变量(属于对象);this表示这个类的当前实例,super表示父类的当前实例,static是属于类的,this是类的一...
为什么super(…)或this(…)调用语句只能作为构造函数中的第一句出现?
class A { A() { System.out.println("You call super class non-args constructor!"); }} class B extends A { B() { //这里,编译器将自动加上 super(); System.out.println("You call subclass constructor!"); } B(String n) {...
为什么super(…)和this(…)调用语句不能同时在一个构造器中出现
构造函数必须出现在第一行上。所以,注定了你只能调用一个构造函数。默认的,父类的或者本类的其它构造,你自己选一个。
No enclosing instance of type Outer is accessible.
No enclosing instance of type Outer is accessible. Must qualify the allocation with an enclosing instance of type Outer (e.g. x.new A() where x is an instance of Outer).点击(此处)折叠或打开class Outer { class Inner {...
为什么不能根据返回类型区分重载?
重载(Overload)和重写(Override)的区别。重载的方法能否根据返回类型进行区分?答:方法的重载和重写都是实现多态的方式,区别在于前者实现的是编译时的多态性,而后者实现的是运行时的多态性。重载发生在一个类中,同名的方法如果有不同的参数列表(参数类型不同、参数个数不同或者二者都不同)则视为重载;重写发生...
java中break标记的使用
break适用范围:只能用于switch或者是循环语句中。break作用:1. break用于switch语句的作用是结束一个switch语句。2. break用于循环语句中的作用是结束当前所在的循环语句。笔试题目:break目前位于内层的for循环,如何才能让break作用于外层 的for循环。可以标记解决标记的命名只要符合标识符的命名规则即可。...
Java中hashCode的作用
以下是关于HashCode的官方文档定义hashcode方法返回该对象的哈希码值。支持该方法是为哈希表提供一些优点,例如,java.util.Hashtable 提供的哈希表。 hashCode 的常规协定是: 在 Java 应用程序执行期间,在同一对象上...