- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVariable.java
More file actions
Latest commit
27 lines (19 loc) · 576 Bytes
/
Copy pathVariable.java
File metadata and controls
27 lines (19 loc) · 576 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
packageUserProgram;
importjava.io.PrintWriter;
publicclassVariable {
privatefinalStringvariableName;
privatefinalintvariableValue;
publicVariable(Stringname, intvalue) {
this.variableName = name;
this.variableValue = value;
}
publicStringgetVariableName() {
returnthis.variableName;
}
publicintgetVariableValue() {
returnthis.variableValue;
}
publicvoidprintVariable(PrintWriterp) {
p.println(" variableName: " + this.variableName + ", variableValue: " + variableValue);
}
}