SortedSet接口为TreeSet做准备
可以实现排序集合
源码
package java.util;public interface SortedSet extends Set {
/**
* 比较器
*/
Comparator comparator(); /**
* 获取子集
* @throw...
分类:
其他好文 时间:
2016-07-17 00:32:18
阅读次数:
229
/**
* 字符串工具类,提供一些字符串相关的便捷方法
*/
public class StringUtil { private StringUtil() {
throw new AssertionError();
} /**
* is null or its length is 0 or it is made by space
* <p/...
分类:
移动开发 时间:
2016-07-15 21:22:10
阅读次数:
217
1、DensityUtils
/**
* 常用单位转换的辅助类
*/
public class DensityUtils
{
private DensityUtils() {
/* cannot be instantiated */
throw new UnsupportedOperationException("cannot be instantiated");
}
/*...
分类:
移动开发 时间:
2016-07-15 11:06:49
阅读次数:
192
C++异常是丢程序运行过程中发生的异常情况(例如被0除)的一种响应。异常提供了将控制权从程序的一个部分传递到另一部分的途径。对异常的处理有3个组成部分:* 引发异常;* 使用处理程序捕获异常;* 使用try块。程序在出现问题时将引发异常。throw语句实际上是跳转,即命令程序跳到另一条语句。thro ...
分类:
编程语言 时间:
2016-07-14 14:55:44
阅读次数:
181
Throw 命令没有Exception severity 参数,The exception severity is always set to 16. Raises an exception and transfers execution to a CATCH block of a TRY…CATC ...
分类:
其他好文 时间:
2016-07-12 23:22:10
阅读次数:
153
Description The Sky is Sprite. The Birds is Fly in the Sky. The Wind is Wonderful. Blew Throw the Trees Trees are Shaking, Leaves are Falling. Lovers ...
分类:
其他好文 时间:
2016-07-11 18:40:58
阅读次数:
140
1. 智能指针背后的设计思想
我们先来看一个简单的例子:
void remodel(std::string & str)
{
std::string * ps = new std::string(str);
...
if (weird_thing())
throw exception();
str = *ps;
dele...
分类:
其他好文 时间:
2016-07-10 18:53:16
阅读次数:
266
区别一:throw 是语句抛出一个异常;throws 是方法抛出一个异常; throw语法:throw <异常对象> 在方法声明中,添加throws子句表示该方法将抛出异常。如果一个方法会有异常,但你并不想处理这个异常,就在方法名后面用throws,这样这个异常就会抛出,谁调用了这个方法谁就要处理这 ...
分类:
其他好文 时间:
2016-07-10 16:59:08
阅读次数:
127
1. C++中的异常处理 (1)catch语句块可以抛出异常 ①catch中获捕的异常可以被重新抛出 ②抛出的异常需要外层的try-catch块来捕获 ③catch(…)块中抛异常的方法是throw;也是将所有异常重新抛出 (2)catch块中重新抛异常的意义 ①可以被外层try-catch块捕获, ...
分类:
编程语言 时间:
2016-07-08 23:22:44
阅读次数:
292
如有错误,望各位指正
本人会做更新
51、类ExampleA继承Exception,类ExampleB继承ExampleA。
有如下代码片断:try {
throw new ExampleB("b")
} catch(ExampleA e){
System.out.println("ExampleA");
} catch(Exception e){
System.ou...
分类:
编程语言 时间:
2016-07-07 14:26:44
阅读次数:
353