📄 passtest.java
字号:
public class PassTest {
// Methods to change the current values
public static void changeInt(int value) {
value = 55;
}
public static void changeObjectRef(MyDate ref) {
ref = new MyDate(1, 1, 2000);
}
public static void changeObjectAttr(MyDate ref) {
ref.setDay(4);
}
public static void main(String args[]) {
MyDate date;
int val;
// Assign the int
val = 11;
// Try to change it
changeInt(val);
// What is the current value?
System.out.println("Int value is: " + val);
// Assign the date
date = new MyDate(22, 7, 1964);
// Try to change it
changeObjectRef(date);
// What is the current value?
date.print();
// Now change the day attribute
// through the object reference
changeObjectAttr(date);
// What is the current value?
date.print();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -