Solved

need advise about this exercise

Posted on 2004-10-18
7
152 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 250 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
numbers ascending pyramid 101 240
login form jsp example 2 50
Eclipse Help Java EE 5,6,7 Documentation, why not Java EE 8 8 44
swing controls 2 23
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

749 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