Search:

Type: Posts; User: helloworld922

Search: Search took 0.11 seconds.

  1. Replies
    18
    Views
    2,504

    Re: What's Wrong With My Code?

    Sorry, I'm not trying to intimidate you, but I do want you to think.

    Ok, so first you have your if statement which checks to see if the time is valid:


    if(this.validate())
    {
    // we have a...
  2. Replies
    18
    Views
    2,504

    Re: What's Wrong With My Code?

    What part are you having trouble with?

    You can perform multiple statements in one if statement by using brackets.

    if(condition== true)
    { // execute all statements in here if condition is true,...
  3. Replies
    18
    Views
    2,504

    Re: What's Wrong With My Code?

    Yes, that's correct. That is indeed the recommended convention.
  4. Replies
    18
    Views
    2,504

    Re: What's Wrong With My Code?

    You can display in a 12 hour format by creating a temporary hour variable, and a temporary string variable to hold "am" or "pm". This variable would hold the value of hh if hh is less than or equal...
  5. Replies
    18
    Views
    2,504

    Re: What's Wrong With My Code?

    Looked up the java language standard, and it turns out that any unicode character which isn't a number or pre-defined java symbol is considered a "JavaLetter", and thus can be used in the name. This...
  6. Replies
    18
    Views
    2,504

    Re: What's Wrong With My Code?

    Yep. The name can start with any letter (upper or lower case), an underscore, or some currency symbols (such as the british pound symbol or dollar symbol). Actually, any valid name for a...
  7. Replies
    18
    Views
    2,504

    Re: What's Wrong With My Code?

    if(hh>12)
    hh=hh-12;
    Time ob = new Time(20,55,30);
    if (ob.validate())


    You're automatically subtracting 12 from hh no matter if the format is valid or not....
  8. Replies
    18
    Views
    2,504

    Re: What's Wrong With My Code?

    Not true. The only requirement is that once you name a class, you must stick to that name. It is generally recommended that you start classes with a capital letter, though. The fixed validate logic...
Results 1 to 8 of 8