①准备工作首先用记事本编写HelloWorld.java放至G:\Javaspace路径public class HelloWorld{public static void main(String []args){System.out.println("Hello World");}}因为我要编译的...
分类:
编程语言 时间:
2014-09-18 14:32:13
阅读次数:
457
一个需求,需要从20140101那天开始,然后一直找到8月份。用newlisp计算日期的话,需要考虑日历月的天数不一样。比较容易的方法是采用epoch秒数,然后每次加一天的描述,再转换成日期字符串,下面的代码如下:#!/usr/bin/newlisp
(println "ok")
(set 'start-date "20140101 00:00")
(set 'start-seconds (d...
分类:
其他好文 时间:
2014-09-18 11:37:03
阅读次数:
272
equals和==的区别?经常被简单的理解为equals方法用来比较两个对象是否相同,而==比较运算符用来比较两个基本数据类型的数值是否相同。这样的理解无可厚非,但还要透过简单看看本质,才会更清晰。1,基本数据类型的值。int x = 3;int y = 3;System.out.println(x...
分类:
其他好文 时间:
2014-09-17 18:32:02
阅读次数:
153
测试代码:System.out.println(0L == 0);//true System.out.println(((Long)0L).equals(0));//false Integer i1 = 100; Integer i2 = 100; Integer i3 = ...
分类:
编程语言 时间:
2014-09-17 18:29:22
阅读次数:
221
@Overridepublic void onScroll(AbsListView view, int firstVisibleItem,int visibleItemCount, int totalItemCount) {// System.out.println("firstVisibleIte...
分类:
移动开发 时间:
2014-09-17 18:25:52
阅读次数:
201
final:
final 可以修饰类、方法、变量
final 修饰的类不可以被继承
final 修饰的方法不可以被覆盖
final 修饰的变量是一个常量,只能被修饰一次
内部类只能访问被final修饰的局部变量
继承的弊端:
如下代码:
class father
{
void show()
{
System.out.println("ni hao ");/...
分类:
编程语言 时间:
2014-09-17 01:11:51
阅读次数:
242
第一种:File f = new File(this.getClass().getResource("/").getPath());System.out.println(f);结果:C:\Documents%20and%20Settings\Administrator\workspace\proje...
分类:
编程语言 时间:
2014-09-16 15:43:10
阅读次数:
162
1.浮点数省略的0System.out.println(.5f); //.5和0.5等价。2.import static引入一个static method后,可以在这个类中直接使用这个method.import static sort.BasicSort.bubbleSort;public cl.....
分类:
编程语言 时间:
2014-09-16 15:41:10
阅读次数:
161
package mainimport ( "fmt" "reflect")type YourT1 struct {}func (y *YourT1) MethodBar() { fmt.Println("MethodBar called")}type YourT2 struct {...
分类:
其他好文 时间:
2014-09-16 14:06:20
阅读次数:
263
char hex[] = {
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
};
byte b = -1;
System.out.println("b = 0x" + hex[(b >> 4) & 0x0f] + hex[b & 0x0f]);...
分类:
其他好文 时间:
2014-09-16 10:44:50
阅读次数:
169