匿名内部类:
1 没有名字的内部类
前提: 必须继承 或者 实现 某个接口!
2 匿名内部类:
创建格式:
方法一:
new Super(){
//override super function()
}.fun();
方法二:
Super s = new Super(){
// override super functi...
分类:
编程语言 时间:
2014-07-27 11:38:05
阅读次数:
282
hdu 1087 Super Jumping! Jumping! Jumping!(dp 最长上升子序列和)...
分类:
其他好文 时间:
2014-07-27 11:32:02
阅读次数:
201
PrototypeTime Limit: 1 Second Memory Limit: 32768 KBPrototype is a 3D game which allow you to control a person named Alex with much super ability t...
分类:
其他好文 时间:
2014-07-27 11:06:42
阅读次数:
328
【Stencil】 The stencil buffer can be used as a general purpose per pixel mask for saving or discarding pixels. The stencil buffer is usually an 8 bit.....
分类:
其他好文 时间:
2014-07-26 16:51:21
阅读次数:
267
经过前两篇blog的铺垫,我们今天热身一下,做个简单的例子。目录结构还是引用上篇blog的截图。具体实现代码:public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceStat...
分类:
移动开发 时间:
2014-07-26 02:58:46
阅读次数:
349
我们常常需要用到按钮需要文字和图片同时显示,例如:
我们需要定义一个UIButton的子类
实现文件
- (id)initWithFrame:(CGRect)frame
{
self = [super
initWithFrame:frame];
if (self) {
//可根据自己的需要随意调整
...
分类:
移动开发 时间:
2014-07-26 02:57:06
阅读次数:
265
先来一个离线版本的线段树: 1 /* 2 ID:esxgx1 3 LANG:C++ 4 PROG:hdu4417 5 */ 6 #include 7 #include 8 #include 9 #include 10 using namespace std; 11 12 ...
分类:
其他好文 时间:
2014-07-26 01:10:16
阅读次数:
289
/* super 的作用: 1 . super可以在子类中引用父类的成员,通过 .的方式和属性。this相对应。 2. 在子类的构造方法中可以可使用super(参数列表)语句调用父类的构造方法 3. 注意: 子类的构造方法中一定要调用父类的构造方法.... */
分类:
编程语言 时间:
2014-07-25 14:22:01
阅读次数:
212
我们都知道 this 和 super 关键字,在 调用 构函数的时候,
都必须写在第一行中!
this 调用的是当前的类的构造函数!
super 调用的是父类的构造函数!
this和super可不可以重复??
class Student extends Person
{
int grade;
Student()
{
super();
S...
分类:
其他好文 时间:
2014-07-25 10:59:31
阅读次数:
246
1 UIView自带的方法 2 1> - (void)layoutSubviews; 3 * 当一个控件的frame发生改变的时候就会自动调用 4 * 一般在这里布局内部的子控件(设置子控件的frame) 5 * 一定要调用super的layoutSubviews方法 6 7 2> - (voi.....
分类:
其他好文 时间:
2014-07-25 02:38:44
阅读次数:
209