1. java中的多重继承
在c++中,组合多个类的接口的行为被称为多重继承。
在java中一个类只能继承一次,但可以实现多个接口,注意,继承必须写在实现前面
2. 使用接口的核心原因:
1) 为了能够向上转型为多个父类型(以及由此而带来的灵活性)
2) 防止程序员创建该类的对象
3. 策略设计模式:
传递不同的StringProcessor实现类,将会分别做不同的事情
...
分类:
编程语言 时间:
2015-01-24 20:07:24
阅读次数:
176
在控制器中:/**
*输出验证码
*/
publicfunctiongetverify(){
$VModle=new\Think\Verify();
$VModle->codeSet=‘0123456789‘;
$VModle->length=4;
$VModle->entry();
}在页面中的html<inputtype="text"name="verify"placeholder="验证码"class="form-control"style=..
分类:
Web程序 时间:
2015-01-23 18:35:11
阅读次数:
153
1. 动态绑定
又称"后期绑定"或"运行时绑定",它的含义就是在运行时判断对象的类型,从而调用恰当的方法
public class Shapes {
private static RandomShapeGenerator gen = new RandomShapeGenerator();
public static void main(String[] args) {
Shape[]...
分类:
编程语言 时间:
2015-01-23 18:22:30
阅读次数:
229
1. 每一个非基本类型的对象都有一个toString方法,而且当编译器需要一个String而你却只有一个对象时,该方法便会被调用。
public class SprinklerSystem {
private String valve;
public String toString() {
value = "test";
return "valve = " + valve;
}...
分类:
编程语言 时间:
2015-01-23 16:22:52
阅读次数:
169
转载:http://blog.csdn.net/yangzhongxuan/article/details/8286771http://www.cherrot.com/2012/09/let-git-diff-merge-use-gui-tools-like-meld/方案一I think Meld...
分类:
其他好文 时间:
2015-01-22 10:57:42
阅读次数:
153
如果程序发生异常,thinkphp默认都是抛出 404 头。
ThinkPHP3.2.3相关代码:
#/ThinkPHP/Library/Think/Think.class.php
/**
* 自定义异常处理
* @access public
* @param mixed $e 异常对象
*/
static public fun...
分类:
Web程序 时间:
2015-01-21 16:37:06
阅读次数:
363
BootstraptorIf you think that bootstrap templates are not enough for you, you should go with bootstraptor. You will have a wide range to select from, ...
分类:
其他好文 时间:
2015-01-21 01:17:13
阅读次数:
536
华为的JAVA面试题(后记:没有想到华为的面试题就是非同一般,非常多题不是一眼就行看得出来,至少对我这种鸟来说是这样。对我个人来说,看看这种题,可能比看《Think In Java》都还要好,由于这里面有非常多的东西,都是我们平时没有太在意,或者是仅仅是懂一点皮毛而已,通过做一下这种练习,把自己不知...
分类:
编程语言 时间:
2015-01-20 15:08:15
阅读次数:
126
(http://leetcode.com/2010/11/convert-binary-search-tree-bst-to.html)Convert a BST to a sorted circular doubly-linked list in-place. Think of the left ...
分类:
其他好文 时间:
2015-01-16 08:42:31
阅读次数:
156
I didn't use this blog system for almost 9 years due to account/password and other issues.After I finally reactivate it, I think it's a good sign for ...
分类:
其他好文 时间:
2015-01-14 00:48:11
阅读次数:
173