?
Solved

need advise about this exercise

Posted on 2004-10-18
7
Medium Priority
?
159 Views
Last Modified: 2010-03-31
CAN SOMEONE PLEASE GUIDE ME ON HOW TO DO THE FOLLOWING

MY EMAIL ADD IS:

<e-mail removed by Venabili>


When answering this question you are advised to take a look at the java.util.Date class to get some idea of the methods you may need. However DO NOT implement more methods than are necessary to meet the requirements as this will clutter your answer.

For this question you need to develop a Instant class in order to represent a particular moment in time. After creating a Instant object by supplying the time in hours, minutes and seconds we want it to be able to respond to the following:
What is the time of this Instant in seconds?
Given another Instant object, is it's time setting before, after or the same as this one?
[In other words compare object of this type]
Create an Instant 5 hours ahead of this one.
0
Comment
Question by:jaanofeastlondon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
7 Comments
 
LVL 14

Accepted Solution

by:
sudhakar_koundinya earned 1000 total points
ID: 12340083
>>After creating a Instant object by supplying the time in hours, minutes and seconds we want it to be able to respond to the following:
 >> What is the time of this Instant in seconds?

use following methods

http://java.sun.com/j2se/1.4.2/docs/api/java/util/Calendar.html#getInstance()
http://java.sun.com/j2se/1.4.2/docs/api/java/util/Calendar.html#set(int, int, int, int, int, int)
http://java.sun.com/j2se/1.4.2/docs/api/java/util/Calendar.html#getTime()
http://java.sun.com/j2se/1.4.2/docs/api/java/util/Date.html#getTime()

>>Create an Instant 5 hours ahead of this one.
use following methods
http://java.sun.com/j2se/1.4.2/docs/api/java/util/Calendar.html#add(int, int)


0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 12340090
let me know if  that is enough for u
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 12340096
otherwise i try to give some more help
but not the code
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 12340107
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses
Course of the Month8 days, 6 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question