---
# System prepended metadata

title: 100 PassArgTest.java

---

# 100 PassArgTest.java
package ch07;
/*
 * 此範例需搭配Pen.java一起參考使用
 * 暸解如何建立物件參考變數，並使用物件參考變數操作資料
 */
public class PenTest {

	public static void main(String[] args) {
		Pen myPen = new Pen();
		myPen.brand = "SKB";
		myPen.price = 10;
		
		Pen yourPen = new Pen();
		yourPen.brand = "MontBlanc";
		yourPen.price = 12000;
		
		myPen.showInfo();
		yourPen.showInfo();
	}

}
