源代码如下:
public static void main(String[] args) throws Exception {
System.out.println("(abc)".replaceAll("(", ""));
}
报错信息如下:
Exception in thread "main" java.util.regex.PatternSyntaxException: Unclo...
分类:
其他好文 时间:
2014-09-22 20:34:43
阅读次数:
922
package com.test.brouse;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
public class Html {
/**
* @param args
* @throws IOE...
分类:
编程语言 时间:
2014-09-22 19:23:43
阅读次数:
281
## finally引起的异常丢失问题 ### 场景一 public void loseException() throws Exception { try { throw new Exception("Exception A"); } finally { throw new Exception("Exception B"); } } 调用 ``` loseEx...
分类:
其他好文 时间:
2014-09-22 14:04:43
阅读次数:
219
package com.hephec;
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;
public class OutputStreamTest{
public static void main(String[] args) throws Exception{
...
分类:
编程语言 时间:
2014-09-19 12:11:45
阅读次数:
221
/**
*
* @Description: 将“壹仟”格式转换成1000
* @param
* @return int
* @throws
*/
public static int getMoneyFromString(String string) {
int result = 0;
if (string.contains("亿")) {
int in...
分类:
其他好文 时间:
2014-09-18 18:58:24
阅读次数:
161
1 throws与throw的区别解析:throws和throw是异常处理时两个常见的关键字,初级程序员常常容易正确理解throw和throws的作用和区别,说明已经能比较深入理解异常处理。Throw用来抛出异常,如果执行了throw语句,程序将发生异常,进入到异常处理机制。Throws用来声明异常...
分类:
编程语言 时间:
2014-09-18 14:29:23
阅读次数:
247
---恢复内容开始---1)用bufferedReader,导入io包import java.io.*;public class A{ public static void main(String[] args) throws IOException { BufferedRe...
分类:
其他好文 时间:
2014-09-18 13:16:33
阅读次数:
254
压缩文件 public static void main(String[] args) throws IOException { String filePath = "E:\\技术部员工工作"; ZipOutputStream outputStream = new ...
分类:
编程语言 时间:
2014-09-18 13:01:03
阅读次数:
221
不使用finally块释放资源 错误的写法: public?void?save(File?f)?throws?IOException?{??
??OutputStream?out?=?new?BufferedOutputStream(new?FileOutputStream(f));??
??out.write(...);??...
分类:
编程语言 时间:
2014-09-17 17:02:52
阅读次数:
320
1 import java.net.InetAddress;2 3 public class T {4 public static void main(String args[]) throws Exception {5 byte[] bs = new byte[] { (byte) 1...
分类:
编程语言 时间:
2014-09-16 15:54:30
阅读次数:
220