zoukankan      html  css  js  c++  java
  • private、public、this关键字

    private关键字
    概念:私有的,一种权限修饰符,用来修饰类的成员
    特点:被修饰的成员只能在本类中访问
    用法:
    - 1. private 数据类型 变量名;
    - 2. private 返回值类型 方法名(参数列表){}
    
    public关键字
    公共的,访问权限修饰符,用来修饰类,成员变量,成员方法等,被修饰的内容可以在任意类中访问
    
    this关键字
    表示本类对象的引用,本质是一个对象
    - 特点
    // 每一个普通方法都有一个this,谁调用该方法,this就指向谁
    - 用法
    // this.属性名
    // this.方法名(参数)
    
    When nothing seems to help, I go look at a stonecutter hammering away at his rock, perhaps a hundred times without as much as a crack showing in it. Yet at the hundred and first blow it will split in two, and I know it was not that blow that did it, but all that had gone before. -- Jacob Riis
  • 相关阅读:
    KVCKVO
    音频
    静态库
    百度地图API
    CALayer
    触摸事件
    iOS中打电话、打开网址、发邮件、发短信等
    NSURLSession网络接口
    Quartz2D常见图形的绘制:线条、多边形、圆
    通知中心(NSNotificationCenter)
  • 原文地址:https://www.cnblogs.com/xhwy-1234/p/12272831.html
Copyright © 2011-2022 走看看