Java
一只小芒果o
简单生活,努力学习!
展开
-
JAVA中math类的几个方法
说一下Java的math类中几个常见的方法: 1.Math.random() 返回一个[0.0,1.0)之间的伪随机数 ,左开右闭. 2.Math.round() 四舍五入 Math.round(2.6) ----> 结果为3 Math.round(-1.5) ----> 结果为-1 3.Math.pow(x...原创 2019-11-11 19:51:43 · 385 阅读 · 0 评论 -
JAVA中类型转换方法
1、Obejct---->String类型 String a=ob.toString() 2. String ----> Int类型 方法一: int i = Integer.parseInt(str); 方法二: int i = Integer.valueOf(str).intValue(); 3. Int ----> String类型 方法一: ...原创 2019-11-09 19:44:05 · 286 阅读 · 0 评论 -
使用DBUtils报错connot create bean 错误解决的办法
public class c3p0_connection { public static void main(String[] args) throws Exception { ComboPooledDataSource source = new ComboPooledDataSource();//创建对象 String sql="select * from ...原创 2019-09-26 10:29:17 · 997 阅读 · 0 评论 -
Java的碎片知识点
1.执行下面两条语句 System.out.println(1+2+"b"); // 3b System.out.println("b"+1+2); // b+12 1.第一条输出3b 。原因是java中低类型遇到高类型向上自动转型为高类型。int < String类型,所以int自动强转为String. 先执行 1+2=3,3遇到"b", 强转为"3b"。 ...转载 2019-09-28 04:43:38 · 104 阅读 · 0 评论