/*
//创建对象的格式:类名对象名= new_ 类名();
Student s = new Student() ;
class Demo1_ Student {
public static void main (String[] args)
//创建对象的格式:类名对象名= new_ 类名();
//对象名:其实就是合法的标识符,如果是一个单词所有字母小写,如果是多个单词,从第二个单词开始首字母大写
Student s = new Student() ;
*/
package com.test;
public class test1 {
public static void main(String[] args) {
student a = new student();
a.age(23);
a.name("lige");
System.out.println(a.name+ " " +a.age);
a.test("zhangsan",18);
}
}
class student{
int age;
String name;
public void age(int age) {
this.age = age;
}
public void name(String name) {
this.name = name;
}
public void test(String name,int age){
System.out.println(name+ " " +age);
}
}