码迷,mamicode.com
首页 >  
搜索关键字:python异常处理 try except assert    ( 20850个结果
LeetCode: Single Number
Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime comple...
分类:其他好文   时间:2014-05-23 07:22:48    阅读次数:241
深入同步语法
1. 深入synchronized关键字 1 class Service{ 2 public void fun1(){ 3 synchronized(this){ 4 try{ 5 Thread.sleep(3000);...
分类:其他好文   时间:2014-05-23 03:28:22    阅读次数:230
leetcode Remove Nth Node From End of List
题目说:Try to do this in one pass 只用一遍遍历的话,p1先走n节点,p2再走,等到p1到达链表尾的时候p2正好在倒数第n+1个上面鸟 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode...
分类:其他好文   时间:2014-05-23 01:52:29    阅读次数:331
2H03-view-radio-group-rating-bar
/* * 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 compliance with the License. * Yo...
分类:其他好文   时间:2014-05-23 00:30:50    阅读次数:415
Java当中的异常(一)
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
Android 删除短信
1.删除短信的函数,一条一条的删除所有短信/* * Delete all SMS one by one */ public void deleteSMS() { try { ContentResolver CR = getContentResolver();...
分类:移动开发   时间:2014-05-22 01:45:15    阅读次数:444
python编程——断言
基本语法assert_stmt ::= "assert" expression ["," expression]1 assert 5 > 3 # 肯定是对的2 assert 0 > 3 # 肯定是错的下面看看扩展的,带上附加...
分类:编程语言   时间:2014-05-22 01:25:06    阅读次数:340
如何更好地利用Pmd、Findbugs和CheckStyle分析结果
这里列出了很多Java静态分析工具,每一种工具关注一个特定的能发挥自己特长的领域,我们可以列举一下:Pmd它是一个基于静态规则集的Java源码分析器,它可以识别出潜在的如下问题:– 可能的bug——空的try/catch/finally/switch块。– 无用代码(Dead code):无用的本地...
分类:数据库   时间:2014-05-21 23:50:58    阅读次数:586
Java示例代码
记录一些典型的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
Junit单元测试类
/*package zxdc.web;import static org.junit.Assert.*;import java.io.IOException;import javax.servlet.ServletException;import javax.servlet.http.HttpSer...
分类:其他好文   时间:2014-05-21 05:20:31    阅读次数:289
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!