Page 2 of 2 First 12
  • Jump to page:
    #16
  1. Java Junkie
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jan 2004
    Location
    Mobile, Alabama
    Posts
    4,021
    Rep Power
    1285
    Your issue is with these two lines.

    Code:
    setHour(int timeHour);
    setMinute(int timeMinute);
    When you call a method, you only send the name of the variable, not the type.

    Comments on this post

    • crownjewel82 agrees
    • clarjon1 agrees
  2. #17
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2006
    Posts
    22
    Rep Power
    0
    Originally Posted by bullet
    Your issue is with these two lines.

    Code:
    setHour(int timeHour);
    setMinute(int timeMinute);
    When you call a method, you only send the name of the variable, not the type.
    Ah, thank you very much. I didn't know that.
  4. #18
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2013
    Posts
    1
    Rep Power
    0

    compiling shows '.class' expected


    and i wrote my program this way...a simple one
    and the error is in following highlighted line

    class ok
    {
    public void calc(String s, String wd)
    {
    int l=s.length();
    for(int i=0;i<=l;i++)
    char ch=s.charAt(i);

    if(ch!='')||(ch!='.')||(ch!='?')
    s1=s1+ch;
    else
    if(ch=='')||(ch=='.')||(ch=='?')
    int l1=s1.length();
    if(s1.equalsIgnoreCase(wd))
    wd=="no";
    s2=s2+s1;
    s1="";
    }
    System.out.println(s2);
    }
    }
  6. #19
  7. Java Junkie
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jan 2004
    Location
    Mobile, Alabama
    Posts
    4,021
    Rep Power
    1285
    When you have an if statement, normally if there is one line in the body, you don't need to use braces around the body. But in the case of a variable declaration, this is not considered a single statement. You need to surround the body with braces.
Page 2 of 2 First 12
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo