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

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

什么類型的?

什么類型的?

陳高高_ 2015-03-15 13:43:27
import javax.swing.*;? ? ?//*********Found********import java.text.*;public class Java_3{? ?public static void main( String args[] )? ?{? ? ?//*********Found********? ? ? SimpleTime t = new ?SimpleTime ( 12, 30, 19 );? ? ?//*********Found********? ? ? JOptionPane.showMessageDialog( null, t.buildString(),? ? ? ? ?"Demonstrating the \"this\" Reference",? ? ?//*********Found********? ? ? ?JOptionPane.INFORMATION_MESSAGE ?);? ? ? System.exit( 0 );? ?}}class SimpleTime {? ?private int hour, minute, second; ??? ?public SimpleTime( int hour, int minute, int second )? ?{? ? ? this.hour = hour;? ? ?//*********Found********? ? ?this.minute = minute;? ? ? this.second = second;? ?}? ?public String buildString()? ?{? ? ?//*********Found********? ? ? return "this.toString(): " +this.toString() ?+? ? ? ? ? ? ?"\ntoString(): " + toString() +? ? ? ? ? ? ?"\nthis (with implicit toString() call): " +? ? ? ? ? ? ?this;? ?}? ?public String toString()? ?{? ? ? DecimalFormat twoDigits = new DecimalFormat( "00" );? ? ??? ? ? return twoDigits.format( this.hour ) + ":" +? ? ? ? ? ? ?twoDigits.format( this.minute ) + ":" +? ? ? ? ? ? ?twoDigits.format( this.second );? ?}}這是java中那個內容的?為什么這么寫?
查看完整描述

1 回答

已采納
?
黃沛元

TA貢獻23條經驗 獲得超5個贊

java圖形界面編程,那些代碼只是顯示格式化的數字.


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

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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