为了账号安全,请及时绑定邮箱和手机立即绑定

什么类型的?

什么类型的?

陳高高_ 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 关注
  • 1200 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信