![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java
double胜
哦也
展开
-
Ecliplse自动生成接口中的方法
选中该部分,shift+alt+s选择override/implement Methods,出现以下界面然后选中要生成的方法即可原创 2018-06-05 10:45:17 · 346 阅读 · 0 评论 -
异常:java.lang.NumberFormatException: For input string:""
由于DAO层部分参数是整形,所以在前端传来数据的时候把传来的数据转成了整形Integer a = Integer.parseInt(request.getParameter("a"));由于定义的验空函数里的参数是String在验空函数里又把a变量转为了String型在前端提交数据的时候,假如a为空,提交后就会出现该异常原因是a为空,在类型转换的时候出现异常。解决:接收数据的变量就用String型...原创 2018-06-22 10:08:39 · 18221 阅读 · 0 评论 -
一个".java"源文件中是否可以包括多个类(不是内部类)?有什么限制?
可以有多个类,但只能有一个public的类,并且public的类名必须与文件名相一致。 为了理解,自己动手试了一下几个类的关系。 1.与public class平行的类 package com.ss.learn2; public class Student { private String name; private Integer age; public Student (...原创 2018-12-12 19:15:33 · 3128 阅读 · 0 评论 -
通过反射生成对象和调用方法
一、通过反射生成无参对象,通过反射调用有参方法 package com.ss.learn.chapter2; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; public class ReflectServiceImpl { public void sayHello(...原创 2018-12-12 22:01:41 · 711 阅读 · 0 评论 -
tomcat报错:Could not open ServletContext resource db.properties
部署ssm的时候,单独把数据库参数作为单独的文件存放在db.properties中,启动服务器的时候访问页面报404,原因是: <!-- 通过context标签引入jdbc.properties --> <context:property-placeholder location="classpath:db.properties"/> 在locaition对应的路...原创 2019-03-14 10:50:02 · 1116 阅读 · 0 评论