Home > Back-end >  java
java

Time:10-06

Define a Student class, the class has two attributes, respectively is name: name, age: the age, class have a show method, function is the output of the students' name, age,

CodePudding user response:

I'm purely for scores, although you this problem is being despised but remember junction post ah, answer to you finish
 
Public class Student {
private String name;
Private Integer age;

Public Student () {}
Public Student (String name, Integer age) {
Super ();
this.name=name;
Enclosing the age=age;
}

Public void show () {
System. The out. Println (" name: "+ name +", the age: "+ age);
}
}