import java.text.DecimalFormat; public class Timel extends Object { private int hour; private int minute; private int second; public Time1() setTime( 0,0,0 ); } public void setTime( int h, int m, int...


Explain the following code.


import java.text.DecimalFormat;<br>public class Timel extends Object {<br>private int hour;<br>private int minute;<br>private int second;<br>public Time1()<br>setTime( 0,0,0 );<br>}<br>public void setTime( int h, int m, int s )<br>hour = ((h >= 0 && h < 24 ) ?h : hour );<br>minute = ((m >= e && m < 60 ) ?m : minute );<br>second = (( s >= 0 && s < 60 ) ? s: second );<br>public String toUniversalstring()<br>DecimalFormat twoDigits = new DecimalFormat(

Extracted text: import java.text.DecimalFormat; public class Timel extends Object { private int hour; private int minute; private int second; public Time1() setTime( 0,0,0 ); } public void setTime( int h, int m, int s ) hour = ((h >= 0 && h < 24="" )="" h="" :="" hour="" );="" minute="((m">= e && m < 60="" )="" m="" :="" minute="" );="" second="((" s="">= 0 && s < 60="" )="" s:="" second="" );="" public="" string="" touniversalstring()="" decimalformat="" twodigits="new" decimalformat(="" "ee"="" );="" return="" twodigits.format(="" hour="" )="" +="" ":"="" +="" twodigits.format(="" minute="" )="" +="" ":"="" +="" twodigits.="" format(="" second="" );="" public="" string="" tostandardstring()="" decimalformat="" twodigits="new" decimalformat(="" "e0"="" );="" return="" (="" (hour="=" 12="" ||="" hour="=" 0)="" 12="" :="" hour="" %="" 12="" )="" +="" ":"="" +="" twodigits.format(="" minute="" )="" +="" ":"="" +="" twodigits.format(="" second="" )="" +="" (="" hour="">< 12="" "="" am"="" :="" "="" pm"="" );="" public="" class="" timetesti="" {="" public="" static="" void="" main(="" string="" args[]="" )="" timel="" time="new" timel();="" string="" output="" -="" "the="" initial="" universal="" time="" is:="" "="" time.touniversalstring()="" +="" "\nthe="" initial="" standard="" time="" is:="" time.tostandardstring();="" time.settime(="" 13,="" 27,="" 6="" );="" output="" +="\n\nUniversal time after setTime is: " +="" time.touniversalstring()="" +="" "\nstandard="" time="" after="" settime="" is:="" "="" +="" time.tostandardstring();="" time.settime(="" 99,="" 99,="" 99="" );="" output="" +="\n\nAfter attempting invalid settings: " \nuniversal="" time:="" "="" +="" time.touniversalsstring()="" +="" "\nstandard="" time:="" "="" +="" time.tostandardstring();="">

Jun 01, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here