博客
关于我
Java语言基础7
阅读量:91 次
发布时间:2019-02-26

本文共 1642 字,大约阅读时间需要 5 分钟。

??????????????????????????????????????private????this?????????????

1. ????????????

??????????????????????????????????????????

????

  • ????????????????????
  • ?????????????????????
  • ???????????????????????????
  • ??????????????????????
  • ????????????????????????????
  • 2. ?????????

    Java????????????

    ???????

  • ???????????????
  • ????????????????
  • 3. ????

    ??????????????????????????????

    ?????

  • ?????? Student().show()?
  • ???????method(new Student())?
  • 4. ??

    ?????????????????????????????????

    private???

    ????????????????????

    5. this???

    ?????????????????????????????

    6. ????

    ????????????????????????????

    ?????????

  • ????????????????????
  • ???????????????????
  • ??????????????????????
  • 7. Student s = new Student();

    ???????????

  • ??????
  • ???????????
  • ?????????
  • ???????
  • ??????
  • ?????????
  • ?????????????
  • 8. ?????

    import java.util.Scanner;class MyMath {    public int add(int a, int b) {        return a + b;    }    public int sub(int a, int b) {        return a - b;    }    public int mul(int a, int b) {        return a * b;    }    public int div(int a, int b) {        return a / b;    }}class MyMathTest {    public static void main(String[] args) {        Scanner sc = new Scanner(System.in);        System.out.println("??????????");        int firstNumber = sc.nextInt();        System.out.println("??????????");        int secondNumber = sc.nextInt();        MyMath mm = new MyMath();        System.out.println("?????" + mm.add(firstNumber, secondNumber));        System.out.println("?????" + mm.sub(firstNumber, secondNumber));        System.out.println("?????" + mm.mul(firstNumber, secondNumber));        System.out.println("?????" + mm.div(firstNumber, secondNumber));    }}

    转载地址:http://hnmz.baihongyu.com/

    你可能感兴趣的文章
    php输出数据到csv文件
    查看>>
    php输出语句
    查看>>
    php运行原理详细说明
    查看>>
    php运行环境出现Undefined index 或variable时解决方法
    查看>>
    php进程通信
    查看>>
    R&Python Data Science 系列:数据处理(2)
    查看>>
    php递归算法总结
    查看>>
    PHP递归遍历文件夹
    查看>>
    R&Python Data Science 系列:数据处理(1)
    查看>>
    php错误日志文件
    查看>>
    PHP错误解决:Array and string offset access syntax with curly braces is deprecated
    查看>>
    php隐藏手机号中间4位方法总结
    查看>>
    php面向对象三大特征封装、多态、继承
    查看>>
    php面向对象全攻略
    查看>>
    php面向对象的基础题
    查看>>
    php面试题二--解决网站大流量高并发方案(从url到硬盘来解决高并发方案总结)...
    查看>>
    php页面增加自选项,php-在Woocommerce中添加新的自定义默认订购目录选项
    查看>>
    php页面静态化技术;学习笔记
    查看>>
    php项目心得以及总结
    查看>>
    R&Python Data Science 系列:数据处理(4)长宽格式数据转换
    查看>>