亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

我想問有沒有簡單的輸出方法呢?我這樣寫的感角不用每次都有一條輸出語句,這樣會不會太繁瑣。

我想問有沒有簡單的輸出方法呢?我這樣寫的感角不用每次都有一條輸出語句,這樣會不會太繁瑣。

京東塔和西瓜子i 2015-10-25 22:32:23
public class HelloWorld{?????? public static void main(String[] args) {??????? int one = 10 ;??????? int two = 20 ;??????? int three;???????? three = one+two;??????? System.out.println("three"+"="+three);???????? three += one;??????? System.out.println("three"+"="+three);???????? three -=one;??????? System.out.println("three"+"="+three);???????? three *= one;??????? System.out.println("three"+"="+three);???????? three /=one;??????? System.out.println("three"+"="+three);???????? three %= one;??????? System.out.println("three"+"="+three? ); ?????? ??????? ??? ??? ?}}
查看完整描述

1 回答

已采納
?
小羊羊ly

TA貢獻2條經驗 獲得超0個贊

定義一個靜態方法output,參數類型為int,方法體中是輸出語句,輸出語句參數即output方法的參數。這樣就只用寫一次System.out.print方法,需要輸出時調用output()方法即可

查看完整回答
反對 回復 2015-10-26
  • 1 回答
  • 0 關注
  • 1242 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號