博客
关于我
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/

    你可能感兴趣的文章
    python读取wav文件并播放[pyaudio/wave]
    查看>>
    python读取txt文件的行数
    查看>>
    Python 中内置的最大堆 API
    查看>>
    Python 中只有一个 True 和一个 False 对象吗?
    查看>>
    python读取mtcars数据集并实现以下操作_关于数据处理。。,Python交流,技术交流区,鱼C论坛 - Powered by Discuz!...
    查看>>
    Python 中多线程与多处理之间的区别
    查看>>
    Python 中如何使用 lambda 函数
    查看>>
    Python 中如何创建多行字符串?
    查看>>
    Python 中如何处理异常?
    查看>>
    Python 中如何实现列表的切片?
    查看>>
    Python 中如何实现字典的排序?
    查看>>
    Python 中常用的数据类型及相关操作详解
    查看>>
    python 中文乱码
    查看>>
    Python 中生成器与普通函数的区别
    查看>>
    Python 中的 *tuple 和 **dict 是什么意思?
    查看>>
    Python 中的 filter() 函数:筛选可迭代对象元素
    查看>>
    Python 中的 Pillow 不允许我打开图像(“超出限制“)
    查看>>
    Python 中的 threading 模块和 multiprocessing 模块有何区别?
    查看>>
    Python 中的 threading 模块和 multiprocessing 模块有何区别?
    查看>>
    Python 中的 Turtle 库详解
    查看>>