# 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(); } }
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up