当类中用到一些固定值时,希望将其定义为const成员变量,防止被修改。但因为const成员变量因为初始化之后就不能修改,因此只能在构造函数的初始化列表中初始化如果是数组,则没有办法在初始化列表中初始化,必须定义为static,放在类外定义例子://const_array.h#include
usin...
分类:
其他好文 时间:
2014-05-12 12:16:52
阅读次数:
228
包名命名规范:1、包名全部小写2、包名一般情况下是域名的倒过来写+个性命名,如:tinyphp.com,就写成com.tinyphp+.xxx打包方法package
+ 包名package test; class Test{ public static void main(String ...
分类:
编程语言 时间:
2014-05-10 18:31:43
阅读次数:
308
一、枚举传统的方式:?在某些情况下,一个类的对象是有限而且固定的。例如季节类,只能有 4
个对象?手动实现枚举类:—private 修饰构造器。—属性使用 private final 修饰。—把该类的所有实例都使用 public static
final 来修饰。练习代码: 1 public cla...
分类:
编程语言 时间:
2014-05-10 06:45:30
阅读次数:
498
参考资料《大话设计模式》using System;using
System.Collections.Generic;using System.Linq;using System.Text;namespace
ds_proxy{ class Program { static ...
分类:
其他好文 时间:
2014-05-10 05:15:33
阅读次数:
290
方法一:public class QuickSortExp1{ public static
void main(String[] args){ int[] sortArray = new int[]{5,7,4,2,9,8,3,6};
System.out.println("before sor.....
分类:
编程语言 时间:
2014-05-10 05:08:46
阅读次数:
496
public class TestSelectSort{ public static void
main(String[] args){ int[] sortArray = new int[]{5,7,4,2,9,8,3,6};
System.out.println("before sortin.....
分类:
编程语言 时间:
2014-05-10 05:04:52
阅读次数:
322
使用工具:Eclipse Stardard 4.32版本(window7环境)
今天我们通过一个及其简单的例子来分析一个java程序是如何在我们的及其上跑起来的。部分内容是参考其他人的,会在参考的地方注明。
我的测试代码部分如下:
public class Test {
public static void main(String[] args) {
new Test()...
分类:
编程语言 时间:
2014-05-10 04:40:10
阅读次数:
414
public class InsertSort{ public static void
main(String[] args){ int[] sortArray = new int[]{5,7,4,2,9,8,3,6};
System.out.println("before sorting ,t.....
分类:
编程语言 时间:
2014-05-10 03:13:15
阅读次数:
342
/** * 转换图片成圆形 * * @param bitmap * 传入Bitmap对象 *
@return */ public static Bitmap toRoundBitmap(Bitmap bitmap)...
分类:
移动开发 时间:
2014-05-10 02:46:10
阅读次数:
436
说明1:表示静态的关键字说明此对象在应用中只存在一份说明2:C#
是面向对象的程序设计语言,每一个函数都属于一个类。
当一个方法被声明为Static时,这个方法是一个静态方法,编译器会在编译时保留这个方法的实现。也就是说,这个方法属于类,但是不属于任何成员,不管这个类的实例是否存在,它们都会存在。就...
分类:
其他好文 时间:
2014-05-10 02:32:36
阅读次数:
275