面向对象编程语言的特征比较

Many languages claim to be Object-Oriented. While the exact definition of the term is highly variable depending upon who you ask, there are several qualities that most will agree an Object-Oriented language should have:

许多编程语言声称自己是面向对象的(Object-Oriented)。但当询问“面向对象”的确切定义时,不同的人的答案区别很大,下面列举几条大家公认的,面向对象语言所应具有的性质 ...

继续阅读

Windows 8.1搭建PHP5.6与Apache 2.4开发环境故障解决

配合使用Apache 2.4.10 Win32(Apache Lounge构建版本)以及PHP 5.6.3 VC11 x86 Thread Safe(VC11 x86 线程安全版本),可以在Windows 8.1操作系统中搭建PHP Web开发环境。

在Windows 8.1操作系统中搭建PHP + Apache Web开发环境时,需要注意如下问题。

1. Apache使用mod_php方式以模块形式集成PHP时,需要使用Thread Safe(线程安全)版本,不要选择Non Thread Safe ...

继续阅读

Java OOP与Python OOP的区别

For a Java guy Python is an anarchic playgound where anyone can grab a club and start mauling your head.

对于Java的忠实粉丝来说,Python就像是一个无政府主义的游乐场,任何人都可以随手拿起一根棍子敲你的头。

For a Python guy Java is a an Orwellian universe where you are constantly shackled to someone ...

继续阅读

Java容器类LinkedList与ArrayList使用时机对比

  大多数Java初学者在使用动态数组时,会不假思索的选择ArrayList。但实际上,除了ArrayList,还有LinkedList可供选用。

  那么,在使用Java的动态数组时,怎样在ArrayList与LinkedList之间做出选择呢?

  一言以蔽之,在大多数使用场景中,ArrayList与ArrayDeque要优于LinkedList。对于初学者来说,在拿不准用哪个时,不妨使用ArrayList。


  LinkedList与ArrayList是List接口的两种不同的实现。LinkedList使用双向链表实现。ArrayList则使用动态可变长数组实现。

  对于标准的链表和数组运算,不同的方法会有不同的算法运行时间。

  对于LinkedList<E>:

  • get(int index)  O(n)
  • add(E element)  O(1)
  • add(int index, E ...

继续阅读

年度归档