Results 1 to 9 of 9
  1. #1
    akshayagr03 is offline Member
    Join Date
    Dec 2012
    Posts
    3
    Rep Power
    0

    Default can u please get the error fixed in compiling

    class Emp
    {
    String name;
    int age;
    double basic;

    void assign(String n,int ag,double b)
    {
    name=n;
    age=ag;
    basic=b;
    }

    void display()
    {
    System.out.println("+gross");
    }

    ret.gross
    {
    }


    class EmpApp
    {
    public static void main(String a[])
    {
    int HRA,DA,e1;
    double gross;
    HRA = 0.4 * basic;
    DA = 0.6 * basic;
    gross = HRA + DA + basic;
    e1.display();

    }
    }

  2. #2
    mxcnrawker is offline Member
    Join Date
    Apr 2012
    Location
    San Jose Ca
    Posts
    16
    Rep Power
    0

    Default Re: can u please get the error fixed in compiling

    Can you please repost, and wrap the code to view it more easier. Its the hashtag icon on the right. Thanks
    Last edited by mxcnrawker; 12-03-2012 at 12:14 AM.

  3. #3
    akshayagr03 is offline Member
    Join Date
    Dec 2012
    Posts
    3
    Rep Power
    0

    Default Re: can u please get the error fixed in compiling

    class Emp
    {
    String name;
    int age;
    double basic;

    void assign(String n,int ag,double b)
    {
    name=n;
    age=ag;
    basic=b;
    }

    void display()
    {
    System.out.println("+gross");
    }

    ret.gross
    {
    }


    class EmpApp
    {
    public static void main(String a[])
    {
    int HRA,DA,e1;
    double gross;
    HRA = 0.4 * basic;
    DA = 0.6 * basic;
    gross = HRA + DA + basic;
    e1.display();

    }
    }

  4. #4
    akshayagr03 is offline Member
    Join Date
    Dec 2012
    Posts
    3
    Rep Power
    0

    Default Re: can u please get the error fixed in compiling

    is this ok

  5. #5
    mxcnrawker is offline Member
    Join Date
    Apr 2012
    Location
    San Jose Ca
    Posts
    16
    Rep Power
    0

    Default Re: can u please get the error fixed in compiling

    Like this

    Java Code:
    class Emp
    {
    String name;
    int age;
    double basic;
    
    void assign(String n,int ag,double b)
    {
    name=n;
    age=ag;
    basic=b;
    }
    
    void display()
    {
    System.out.println("+gross");
    }
    
    ret.gross
    {
    }
    
    
    class EmpApp
    {
    public static void main(String a[])
    {
    int HRA,DA,e1;
    double gross;
    HRA = 0.4 * basic;
    DA = 0.6 * basic;
    gross = HRA + DA + basic;
    e1.display();
    
    }
    }

  6. #6
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,755
    Rep Power
    7

    Default Re: can u please get the error fixed in compiling

    It would help if you included the full and exact error messages.

  7. #7
    mxcnrawker is offline Member
    Join Date
    Apr 2012
    Location
    San Jose Ca
    Posts
    16
    Rep Power
    0

    Default Re: can u please get the error fixed in compiling

    There is no reference to Basic in the main method, its a variable in the Emp Class. What are you trying to achieve?

  8. #8
    mxcnrawker is offline Member
    Join Date
    Apr 2012
    Location
    San Jose Ca
    Posts
    16
    Rep Power
    0

    Default Re: can u please get the error fixed in compiling

    Quote Originally Posted by Junky View Post
    It would help if you included the full and exact error messages.
    Agree

  9. #9
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,755
    Rep Power
    7

    Default Re: can u please get the error fixed in compiling

    Java Code:
    ret.gross
    {
    }
    What is that supposed to be?

Similar Threads

  1. Replies: 2
    Last Post: 10-05-2012, 10:37 PM
  2. I keep recieving a token error, How can this be fixed ?
    By Daggerfang in forum New To Java
    Replies: 8
    Last Post: 10-05-2012, 08:24 PM
  3. Compiling error
    By robbierut in forum Java Applets
    Replies: 4
    Last Post: 11-24-2010, 05:00 PM
  4. Error FIxed type attribute not equal
    By phoenix_yadu in forum Advanced Java
    Replies: 2
    Last Post: 04-23-2009, 04:36 PM
  5. Compiling error
    By lawksalih in forum New To Java
    Replies: 6
    Last Post: 01-29-2008, 07:26 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
  •