package com.shrimpking.t9;
/**
* Created by IntelliJ IDEA.
*
* @Author : Shrimpking
* @create 2024/9/26 16:47
*/
public class Student3_4
{
static int ageMax = 100; //类变量
String name; //成员变量
//无参构造方法
public Student3_4(){
this.name = "zhang";
}
//类方法
public static int getAgeMax(){
return ageMax;
}
//对象实例方法
public void display(){
System.out.println("我是display方法的打印语句");
}
public static void main(String[] args)
{
Student3_4 stu = new Student3_4(); //实例化
stu.display(); //调用实例方法
int age = Student3_4.getAgeMax(); //调用类方法
}
}
02-08