自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

爱编程爱八卦

做个快乐的程序媛

  • 博客(6)
  • 资源 (2)
  • 收藏
  • 关注

转载 日志记录的作用和方法 java

程序中记录日志一般有两个目的:Troubleshooting和显示程序运行状态。好的日志记录方式可以提供我们足够多定位问题的依据。日志记录大家都会认为简单,但如何通过日志可以高效定位问题并不是简单的事情。这里列举下面三个方面的内容,辅以代码示例,总结如何写好日志,希望对他人有所启发和帮助:怎样记日志可以方便Troubleshooting程序运行状态可以记哪些应该避免怎样

2014-10-14 17:00:02 679

原创 说一说struts2 验证框架使用过程中遇到的问题

说到struts2验证框架的使用,首先假定使用的时候已经有了对该框架的基本概念,即:     1)知道该怎么编写待验证的jsp页面。     2)知道该怎么编写jsp页面form表格所对应的Action类。     3)知道怎么在struts.xml文件中配置Action。     4)知道怎么编写Action类-validation.xml文件。     知道了以上基本概

2014-07-13 17:35:12 549

原创 Java 之 初始化(二)

在上一篇文章中讲述了类的成员变量及成员函数的初始化顺序,以及不同类型的成员变量被初始化的次数。在Java中,除了可以在定义成员变量的时候对成员变量进行初始化,还可以通过显示的初始化块来对成员变量进行初始化。        对于显示的初始化代码块,我们可以提出以下几个问题:       1)它何时被执行?(相对于成员变量的定义以及构造函数的执行时间)       2)它被执行几次? 

2013-12-16 18:22:40 486

原创 Java 之 初始化(一)

在Java中,对象中的成员变量在使用前都会被初始化。如果没有对成员变量进行显示的初始化,那么这些成员变量就会被自动初始化。在自动初始化的过程中,基本类型的成员变量其值为0,引用类型的成员变量其值为null。      初始化过程中的成员变量值容易确定,那么对象成员的初始化顺序又是怎样的呢?在《Thinking in Java》一书中,给出一个例子来对Java中初始化的顺序来进行说明。第

2013-12-16 16:28:20 567

原创 Java之多线程学习(一)

class RunnableTest implements Runnable{ private int count=0; @Override public void run() { while(this.count < 10) { this.count ++; System.out.println(this.count); } }}class Threa

2013-12-14 13:50:28 457

原创 #J2EE之Servlet#——入门篇:JDK&Tomcat 开发环境搭建和配置

No 1:JDK 的安装及环境变量配置第一步:到www.org.com 上下载 jdk 的exe文件,并安装。记下自己的安装目录%JAVA_HOME%。安装好了以后在安装目录下面会出现两个文件夹,分别为jdk文件夹和jre文件夹。在上一次安装中,我的安装目录 %JAVA_HOME% = D:\Program Files\Java 该目录下的jdk文件夹为:jdk1.7.0_45

2013-10-23 17:56:53 743

Objective-C 教程

Introduction viii Chapter 1: Getting Started: Essential Objective-C 1 Creating Your First Program. . . . . . . . . . . . . . . . . . . . . . 3 Compiling and Running Your First Program . ......... 6 Using Variables . .................................................................... 8 Displaying Values in Variables . ....................................... 9 Working with Data Types . ............................................. 11 Adding Comments . ............................................................ 13 Using Arithmetic Operators . ......................................... 15 Using Assignment Operators . ....................................... 17 Using the Increment and Decrement Operators . ........................................... 19 Changing Type with Cast Operators . ...................... 21 Chapter 2: Directing Program Flow 23 Using the if Statement . ................................................... 26 Using the else Statement . ............................................... 27 Using the switch Statement . ......................................... 29 Using Comparison Operators . ..................................... 31 Using Logical Operators . ............................................... 32 Using the Conditional Operator . ................................ 33 Using the for Loop . ............................................................ 35 Using the while Loop . ...................................................... 37 Using the do...while Loop . ............................................. 39 Using the break Statement . ......................................... 41 Chapter 3: Handling Data 43 About Creating NS-Class Objects . .............................. 45 Creating Arrays . .................................................................. 46 Initializing Arrays . .............................................................. 47 Looping over Arrays . ........................................................ 48 Creating Two-Dimensional Arrays . .......................... 49 Using Pointers . .................................................................... 51 Using Pointer Math . .......................................................... 52 Interchanging Pointers and Arrays . .......................... 53 Using Strings . ....................................................................... 54 Passing Messages to String Objects . .......................... 56 Using Enumerations . ........................................................ 57 Table of Contents From the Library of Wow! eBook v Table of Contents Table of Contents Chapter 4: Creating Functions 59 Defining a Function . .......................................................... 61 Declaring Functions Using Prototypes . .................... 62 Passing Arguments to Functions . .............................. 64 Returning Values from Functions . .............................. 66 Using Function Scope . ...................................................... 68 Passing Pointers to Functions . ..................................... 70 Passing Arrays to Functions . ....................................... 72 Passing Constant Data to Functions . ........................ 74 Using Recursion . ................................................................ 76 Using Pointers to Functions . ....................................... 77 Chapter 5: Classes and Objects 79 Creating Objective-C Classes and Objects . ........... 82 Using Class Methods . ........................................................ 84 Creating an Object . ............................................................ 86 Creating Object Methods . ............................................. 87 Storing Data in Objects . ................................................. 88 Passing Multiple Arguments to Methods . ............. 90 Storing the Interface in a Header File . ...................... 92 Adding the Implementation to the Header File . . . 94 Linking Multiple Files . ................................................... 95 Using Constructors . .......................................................... 97 Chapter 6: Object-Oriented Programming 99 About Access Specifiers . ............................................... 100 Using Public Access . ...................................................... 102 Using Private Access . ................................................... 103 Using Protected Access . ............................................... 105 Using Class Variables . ................................................... 107 Accessing the Current Object . .................................. 109 Creating a Variable for Multiple Object Types . ............................................................ 111 Verifying That an Object Belongs to a Class .... 113 Checking an Object's Class with isKindOfClass . .......................................................... 115 Verifying That an Object Supports a Method .... 117 Checking Whether Objects Support a Method ... 118 Chapter 7: Working with Object-Oriented Inheritance 119 Inheriting from a Class . ............................................... 121 Inheriting Base-Class Data Members . ................. 122 Inheriting Base-Class Methods . .............................. 124 Overriding Base-Class Methods . .............................. 126 Overloading Base-Class Methods . .......................... 128 From the Library of Wow! eBook vi Table of Contents Table of Contents Using Multi-level Inheritance . .................................. 130 Limiting Access . .............................................................. 132 Restricting Access . .......................................................... 134 Using Constructors with Inheritance . ................. 136 Using Polymorphism . ................................................... 138 Chapter 8: Categories, Posing, and Protocols 141 About Categories . ............................................................ 143 Categories: Creating the Base Class . ...................... 145 Categories: Creating Categories . .............................. 146 Categories: Putting It All Together . .......................... 147 About Posing . .................................................................... 149 Posing: Creating the Base Class . ................................ 151 Posing: Creating the Derived Class . ........................ 152 Posing: Putting It All Together . .................................. 153 About Protocols . .............................................................. 155 Protocols: Defining the Protocol and Interfaces . ................................................................ 157 Protocols: Creating the Class Implementations . ................................................... 159 Protocols: Putting It All Together . ............................ 161 Chapter 9: Using Arrays and Dictionaries 163 Creating an Array . .......................................................... 165 Accessing Array Elements . ........................................... 166 Using Enumeration to Loop over an Array . ......... 167 Creating a Mutable Array . ........................................... 169 Adding Elements to a Mutable Array . .................... 171 Sorting an Array . .............................................................. 173 Releasing Array Memory . ............................................. 175 Creating a Dictionary . ................................................... 176 Enumerating a Dictionary . ....................................... 178 Creating a Mutable Dictionary . ................................ 180 Adding Objects to a Mutable Dictionary . ............. 181 Chapter 10: Managing Memory in Objective-C 183 Creating Test Objects . ................................................... 185 Displaying the Retain Count . ..................................... 186 Incrementing an Object’s Retain Count . ............... 188 Decrementing an Object’s Retain Count . ........... 190 Deallocating Objects from Memory . ...................... 192 Using an Autorelease Pool . ......................................... 194 Using Self-Managed Memory . .................................. 195 Deallocating Memory Yourself: Creating the Class . ..................................................................... 197 From the Library of Wow! eBook vii Table of Contents Table of Contents Deallocating Memory Yourself: Storing Internal Objects . ...................................................... 198 Deallocating Memory Yourself: Creating the main Method . ................................................... 200 Deallocating Memory Yourself: Performing Deallocation . ............................................................ 201 Chapter 11: Exception Handling 203 Catching Exceptions . ...................................................... 205 Handling Exceptions . ...................................................... 206 Using the End Handler . ................................................. 207 Creating an Exception . ................................................. 209 Checking What Exception Occurred . .................... 211 Handling Multiple Exceptions . .................................. 213 Passing Exceptions Up the Call Stack . .................... 215 Returning Values from Exception Handlers . ....... 217 Returning void from an Exception Handler . ....... 219 Catching Uncaught Exceptions . .............................. 221

2011-11-01

vs2010全部快捷键 txt文档

Vs2010快捷键。免费分享,无资源分,哈哈。

2011-07-14

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除