你能保证你的程序不会出问题吗?
不能
当你的程序运行到某个地方发生了你不想要的结果,你是否想让它一错再错?
不想
你是否想让你的程序占着茅坑不拉屎?
不想
你是否想知道你的程序出错的原因?
想
看了了这4个问题之后,如果你的回答和我的一致,那么请看下文
trycatch finally的用法:
try
'你想要写的程序
catch
'捕获你想写的程...
分类:
Web程序 时间:
2014-05-22 11:47:21
阅读次数:
358
Gallery和swithcer联合使用
/*
* Copyright (C) 2007 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in complian...
分类:
其他好文 时间:
2014-05-22 11:19:05
阅读次数:
288
相对于VB而言,VB.NET中引入了许多特色。其中最吸引我的就是引入了结构化异常处理。虽然VB.NET仍然支持OnError
Goto类型的异常处理,但是这样做并不是很好。相比而言,结构化异常处理更加灵活,使用更加方便。我们应该充分利用VB.NET提供的结构化异常处理。
在VB.NET结构中的异常处理分为3个语句块。
(1)try块负责错误代码的捕获
(2)catch...
分类:
Web程序 时间:
2014-05-22 09:56:49
阅读次数:
214
从main()函数开始
public static void main(String [] args) {
VersionInfo.logVersion();
new HMasterCommandLine(HMaster.class).doMain(args);
}
public void doMain(String args[]) {
try {
...
分类:
其他好文 时间:
2014-05-22 09:31:11
阅读次数:
348
<!--
Copyright 2011 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the L...
分类:
移动开发 时间:
2014-05-22 08:41:44
阅读次数:
377
上联:no zuo no die why you try
下联:no try no high give me five
横批: let it go。
坑爹bug:
错误写法:
0 } ">true (最后一个大括号后多出一个空格,代码啥都不会输出)
正确写法: 0 }">true 正确写法 输出结果: true...
分类:
Web程序 时间:
2014-05-22 07:42:52
阅读次数:
355
1. 什么是异常2. 异常的分类3. try...catch..finally结构的使用方法1.
什么是异常 异常:中断了 正常指令流的 事件 异常 是在程序运行的时候产生的 1 class Test{2 public static void
main(String args []){3 ...
分类:
编程语言 时间:
2014-05-22 03:33:39
阅读次数:
346
1.删除短信的函数,一条一条的删除所有短信/* * Delete all SMS one by one
*/ public void deleteSMS() { try { ContentResolver CR = getContentResolver();...
分类:
移动开发 时间:
2014-05-22 01:45:15
阅读次数:
444
这里列出了很多Java静态分析工具,每一种工具关注一个特定的能发挥自己特长的领域,我们可以列举一下:Pmd它是一个基于静态规则集的Java源码分析器,它可以识别出潜在的如下问题:–
可能的bug——空的try/catch/finally/switch块。– 无用代码(Dead code):无用的本地...
分类:
数据库 时间:
2014-05-21 23:50:58
阅读次数:
586
记录一些典型的Java代码。一、文件读取 1 public class Test4 { 2
public static void main(String[] args) { 3 try { 4 FileReader fdFileReader=new
F...
分类:
编程语言 时间:
2014-05-21 17:39:52
阅读次数:
259