Results 1 to 3 of 3
  1. #1
    katie is offline Member
    Join Date
    Jul 2007
    Posts
    41
    Rep Power
    0

    Default help with simple program in java

    I can't figure out what the problem is

    Can you help me?
    Java Code:
    public class test1
    {
    public static void main (String[] args)
    {
    int a = 5;
    int b = 3;
    int c = 0;
    double result= sub(int a, int b, int c);
    }
    the method :
    Java Code:
    public double sub(int a, int b, int c);
    {
    double calc = ((a-b)/b-c)-a
    return calc;
    }
    The error:
    Java Code:
    
    interest.java:9: '.class' expected
    sub(int a, int b,int c);
    ^

  2. #2
    hardwired's Avatar
    hardwired is offline Senior Member
    Join Date
    Jul 2007
    Posts
    1,576
    Rep Power
    8

    Default

    public double sub(int a, int b, int c);
    There is an errant semi–colon at the end of this method signature.

  3. #3
    katie is offline Member
    Join Date
    Jul 2007
    Posts
    41
    Rep Power
    0

Similar Threads

  1. Replies: 0
    Last Post: 04-04-2008, 02:40 PM
  2. Peculiarty in code of simple program...
    By Kreuz14 in forum New To Java
    Replies: 4
    Last Post: 01-23-2008, 03:27 AM
  3. Simple java
    By abhiN in forum New To Java
    Replies: 1
    Last Post: 01-16-2008, 10:13 AM
  4. Replies: 0
    Last Post: 10-04-2007, 09:33 PM
  5. help with simple java program
    By leonard in forum New To Java
    Replies: 3
    Last Post: 07-30-2007, 09:40 AM

Posting Permissions

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