Results 1 to 3 of 3

Thread: Help Debug

  1. #1
    Desmond is offline Member
    Join Date
    Mar 2010
    Posts
    17
    Rep Power
    0

    Default Help Debug

    Someone plz help me debug this simple code

    Java Code:
    import java.util.Scanner;
    
    class ReturnValue
    {
    	public static void main (String[] args)
    	{
    	long timePeriodMinutes	
            long timestamp1, timestamp2;
    
          System.out.println("Enter Two timestamps :");
          Scanner keyboard = new Scanner(System.in);
    
          timestamp1 = keyboard.nextLong();
          timestamp2 = keyboard.nextLong();
    
    
           System.out.println("Time in rounded minutes : "+timePeriodMinutes*(long            timestamp1, timestamp2));
    	}
    	  public*static*long*timePeriodMinutes*(long timestamp1, timestamp2)
    	{
    	 double*times;
             if*((timestamp1<0) || (timestamp2<0))
             times*=*-1;
           else
             times = (timestamp1-timestamp2)/(1000 *60);
             times = Math.abs(times);
             times = Math.ceil(times);
    
              return*times;
    	}
    }

  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    6

    Default

    Finished debugging. Did you have a question?

    And what is wrong with your other thread? http://www.java-forums.org/new-java/...-new-post.html

    Just in case you are wondering why you get strange replies read this: http://www.catb.org/~esr/faqs/smart-...ons.html#intro
    Last edited by PhHein; 03-18-2010 at 10:18 AM.
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

Similar Threads

  1. Help Debug
    By Desmond in forum New To Java
    Replies: 9
    Last Post: 03-18-2010, 03:33 PM
  2. different behavior between debug and run
    By flaquitqm in forum Eclipse
    Replies: 1
    Last Post: 03-04-2010, 03:01 PM
  3. Help with debug
    By SwEeTAcTioN in forum New To Java
    Replies: 9
    Last Post: 11-22-2009, 04:39 AM
  4. Debug challenge: how do you debug a Java program?
    By CJSLMAN in forum New To Java
    Replies: 60
    Last Post: 07-04-2009, 10:28 AM
  5. SciTE-debug 0.9.1
    By Java Tip in forum Java Software
    Replies: 0
    Last Post: 04-10-2008, 04:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •