java pgme for class members hours:minutes:seconds then the
constructor expects milliseconds as assignment and initialize
data members the members function print hh:mm:ss 90,000
milliseconds passed in constructor then the output is 00:01:30



java pgme for class members hours:minutes:seconds then the constructor expects milliseconds as assi..

Answer / Ruby Kumari Saha

Here's a simple Java code snippet demonstrating this behavior:nn```javanpublic class Time { n private long timeInMilliseconds;nn public Time(long timeInMilliseconds) {n this.timeInMilliseconds = timeInMilliseconds;n }nn public void members() {n int hours = (int) (timeInMilliseconds / (1000 * 60 * 60));n int minutes = (int) ((timeInMilliseconds % (1000 * 60 * 60)) / (1000 * 60));n int seconds = (int) ((timeInMilliseconds % (1000 * 60 * 60)) % (1000 * 60)) / 1000;n System.out.printf("%d:%02d:%02d", hours, minutes, seconds);n }n}nnpublic class Main {n public static void main(String[] args) {n Time time = new Time(90000);ntime.members();n }n}```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JavaScript Interview Questions

How do you create a new object in JavaScript?

3 Answers   Satyam,


Which is faster jquery or javascript?

1 Answers  


what is difference between client side scripting and server side scripting?

6 Answers   IBM, NIIT,


Which company developed JavaScript?

1 Answers  


How do I open javascript in browser?

1 Answers  


How do I find javascript?

1 Answers  


How can javascript be used to improve the "look and feel" of a web site? By the same token, how can javascript be used to improve the user interface?

1 Answers  


Are there any predefined constant provided by the browser with the key code values that can be reused?

1 Answers  


How to reload a page using JavaScript?

1 Answers  


When selecting the states by giving the country as input using ajax cal, how can we ensure that every time it is hitting the DB and fetching the data? Many time it may load from the cache.

1 Answers   CTS, GE,


Is javascript backend or frontend?

1 Answers  


What is escape & unescape String functions in JavaScript?

1 Answers  


Categories