Results 1 to 2 of 2
  1. #1
    Joy4hacks's Avatar
    Join Date
    Nov 2012
    Gender
    male
    Posts
    62
    Reputation
    10
    Thanks
    2
    My Mood
    Happy

    Question Java Code time in and time out

    String tin[] = timeIn.split(":");
    String tout[] = timeOut.split(":");

    hours += ( Double.parseDouble(tout[0]) - Double.parseDouble(tin[0]) ) >= 9 ? 8 : Double.parseDouble(tout[0]) - Double.parseDouble(tin[0]);

    someone tell me what this means?..i dont understand the part " 9 ? 8 : Double.parseDouble(tout[0]) - Double.parseDouble(tin[0]);


    currently practicing java.
    pls answer me guys..

  2. #2
    elamre's Avatar
    Join Date
    Mar 2013
    Gender
    male
    Posts
    2
    Reputation
    10
    Thanks
    1
    Quote Originally Posted by Joy4hacks View Post
    String tin[] = timeIn.split(":");
    String tout[] = timeOut.split(":");

    hours += ( Double.parseDouble(tout[0]) - Double.parseDouble(tin[0]) ) >= 9 ? 8 : Double.parseDouble(tout[0]) - Double.parseDouble(tin[0]);

    someone tell me what this means?..i dont understand the part " 9 ? 8 : Double.parseDouble(tout[0]) - Double.parseDouble(tin[0]);


    currently practicing java.
    pls answer me guys..

    This is a very rare expression, which barely gets used sadly enough.
    It's basically the same as:

    Code:
    if(expression){
    
    }else{
    
    }
    So here you have:
    Code:
    if(double - double >=9){
       hours+=8;
    }else{
       hours+=double-double;
    }

  3. The Following User Says Thank You to elamre For This Useful Post:

    Joy4hacks (03-17-2013)

Similar Threads

  1. Time And Fate [Out of map] Extensions and Spots 1
    By LegalGaming in forum Call of Duty Black Ops 2 Discussions
    Replies: 1
    Last Post: 01-17-2013, 06:17 PM
  2. Suddenly Spec and Time out
    By CreepyMoto in forum Call of Duty Modern Warfare 2 Help
    Replies: 2
    Last Post: 01-11-2010, 03:08 PM
  3. How to Change Date and Time
    By chocolatedaddy in forum Call of Duty Modern Warfare 2 Help
    Replies: 3
    Last Post: 12-03-2009, 02:45 PM
  4. [Request]KD ratio and time ct hack! :D
    By sacredcrowds in forum Blackshot Hacks & Cheats
    Replies: 6
    Last Post: 06-11-2009, 09:42 PM
  5. im a big time noob and i need help
    By MoshPit1488 in forum Combat Arms Hacks & Cheats
    Replies: 6
    Last Post: 12-23-2008, 03:13 AM

Tags for this Thread