请问图中左边第八行为什么会报错,明明照着打的,看不出错误在哪
package txet2;
public class studenttese {
public static void main(String[] args) {
//创建对象
//调用空参构造
// student s=new student();
student s = new student(name:"zhanzhan", age:23);
System.out.println(s.getName());
System.out.println(s.getAge());
}
}
package txet2;
public class student {
private String name;
private int age;
//如果自己没有写任何构造方法
//虚拟机会给我们加一个空参构造方法
public student() {
System.out.println("看看我执行了吗?");
}
public student(String name, int age) {
this.name = name;
this.age = age;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
}