摘要: 创建类 类是一种抽象的数据类型,它是对某一事物的整体描述,并不能代替某一具体的事物 #一个类里面只有属性跟方法 public class Studyent { //属性:字段 String name; int age;​ //方法 public void study(){ //this:当前这个类 阅读全文
posted @ 2021-09-27 23:20 fantasyfa 阅读(66) 评论(0) 推荐(0)
摘要: 回顾方法的定义 package se.oop;​//Dome01就是类public class Demo01 {​ //main方法 public static void main(String[] args) {​ } /*修饰符 返回值类型 方法名(形参) //方法体 return:返回值 */ 阅读全文
posted @ 2021-09-27 00:54 fantasyfa 阅读(45) 评论(0) 推荐(0)