随笔分类 -  Java

做一只快乐的程序员!
摘要:一:return语句总是用在方法中,有两个作用: 一个是返回方法指定类型的值(这个值总是确定的), 一个是结束方法的执行(仅仅一个return语句)。二:实例1 -- 返回一个Stringprivate String gets(){ String s = "qw789" ; ... 阅读全文
posted @ 2016-01-22 18:06 赵彦军 阅读(14291) 评论(1) 推荐(0)
摘要:1 package com; 2 3 public class T2 { 4 5 public static void main(String[] args) { 6 7 System.out.println(calculateProfit(0.233)); 8 ... 阅读全文
posted @ 2015-10-09 17:28 赵彦军 阅读(997) 评论(0) 推荐(0)
摘要:package com;public class T2 { public static void main(String[] args) { System.out.println(calculateProfit(0)); System.out.println(cal... 阅读全文
posted @ 2015-10-09 16:49 赵彦军 阅读(9269) 评论(0) 推荐(1)
摘要:1、自定义异常package com;public class ZeroException extends Exception { private static final long serialVersionUID = 1L; public ZeroException(){ ... 阅读全文
posted @ 2015-06-21 14:02 赵彦军 阅读(1558) 评论(0) 推荐(0)
摘要:1、几种常见的转换符 转换符 说明 实例 %d 整数类型(十进制) 99 %f 浮点类型 99.99... 阅读全文
posted @ 2015-06-10 15:17 赵彦军 阅读(615) 评论(1) 推荐(0)
摘要:目标:实现对Person 对象的年龄,从小到大排序1、实现排序 1 package com.app; 2 3 import java.util.ArrayList; 4 import java.util.Collections; 5 import java.util.Comparator; 6 im... 阅读全文
posted @ 2015-05-29 14:09 赵彦军 阅读(7294) 评论(0) 推荐(0)