Define two class
During the class {
Int year;
During the public Year (int) {
During this.=year;
}
Public int getValue () {
Return this. The year;
}
During public void setValue (int) {
During this.=year;
}
}
CLSS Date {
During the Year.
Public DateUtil () {
Year=New Year ();
}
Public DateUtil (int y) {
QWQ
}
The public Year setYear () {
Return this. The year;
}
Public void setYear (Year Year) {
During this.=year;
}
}
Can I enter a y from the main function, the Date the Date=new Date (y);
Then how I will y values assigned to the custom during the class
Public DateUtil (int y) {
}
Should write? Turn to
CodePudding user response:
???? Assignment in the calling line.CodePudding user response:
What=y;CodePudding user response:
CLSS Date {
During the Year.
Public DateUtil () {
Year=New Year ();
}
Public DateUtil (int y) {
QWQ this place
}
The public Year setYear () {
Return this. The year;
}
Public void setYear (Year Year) {
During this.=year;
}
}
This kind of writing, you compile?
CLSS Date {
During the Year.
Public Date () {
During this.=New Year ();
}
Public Date (int y) {
The area/moving/QWQ
During this.=New Year (y);
}
The public Year getYear () {
Return this. The year;
}
Public void setYear (Year Year) {
During this.=year;
}
}
CodePudding user response: