Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

need advise about this exercise

Posted on 2004-10-18
7
Medium Priority
?
163 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

618 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