I'm doing a program, and that program has student data.
In my Student
class it has the following content:
public class Student{
String capital;
double note;
int registration;
}
In my 'Info' class it has the following content:
public class Info{
static string name;
static String address;
static int age;
And in my 'Main' class it has the following content:
public class Main {
public static void main(String [] args){
currentStudent Student = New Student ();
current.Student.capital= "Peter";
currentStudent.note = 8.0;
currentStudent.registration= 876;
Info f = new Info();
Info.name= "Peter";
Info.address= "Boulevard treet";
Info.age= 43;
}
How do I change the 'capital' attribute of the 'Student' class so that this attribute is now of the 'Info' type. nd how do I assign this instance to a 'student'?
question from:
https://stackoverflow.com/questions/65831289/about-attributes-methods-in-java 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…