package com.sf.day10; import com.sf.test.Outer01; import org.junit.Test; public class Student { String name; int age; static String major; //静态变量 @Override public String toString() { return "Student{" + "name='" + name + '\'' + ", age=" + age + ",major" +major+ '}'; } /** * 静态方法 * @param * Arrays copyOf(原数组,数组长度) */ public static void getInfo(){ System.out.println("获取信息"); } /** * 实例方法 */ public void get(){ System.out.println("实例方法"); } @Test public void t1(){ Student student = new Student(); student.get(); } public static void main(String[] args) { Student student = new Student(); student.get(); // get(); // // Student student = new Student(); // student.name = "zs"; // student.age = 19; // major = "JAVA"; // System.out.println(student); // System.out.println(major); // // // Student student1 = new Student(); // student1.name = "zs"; // student1.age = 19; // System.out.println(student1); // System.out.println(major); getInfo(); } }