Link to home
Create AccountLog in
Avatar of Panos
PanosFlag for Germany

asked on

Java error

Hello experts.
I'm very new in java
I have a problem with my first code.
Using cmd i get the following error:
C:\vaggelis\askisi1>javac newaskisi1.java
newaskisi1.java:79: error: cannot find symbol
    Synt = Yp.getSyntelestisKratiseon();
                  ^
  symbol:   method getSyntelestisKratiseon()
  location: variable Yp of type Employee
1 error
class Employee { 

private String Eponymia; 
private String AFM; 
private int  Meres_Ergasias;
private double Hmeromisthio;
private float Yperories;
private float Syntelestis_Kratiseon;
private int Akatharistos_Misthos;


public Employee() { 
  Eponymia =""; 
  AFM ="";
  Meres_Ergasias = 0;
  Hmeromisthio = 0.0;
  Yperories = 0.00f;
  Syntelestis_Kratiseon = 0.0f;
  Akatharistos_Misthos = 0;
  
} 
//pliris constructor 
public Employee(String Epon, String AFM2, int Mer_Erg, double Hmer, float Yper , float Syntel, int Akatha ) { 
 Eponymia = Epon; 
 AFM = AFM2; 
 Meres_Ergasias = Mer_Erg;
 Hmeromisthio = Hmer;
 Yperories = Yper;
 Syntelestis_Kratiseon = Syntel;
 Akatharistos_Misthos = Akatha;

} 

public String getEponymia () { 
    return Eponymia;
 }
public String getAFM () { 
    return AFM; 
 } 
public int getMeres_Ergasias () { 
  return Meres_Ergasias; 
}
public double getHmeromisthio () { 
  return Hmeromisthio; 
}
public float getYperories() { 
  return Yperories; 
}
public float Syntelestis_Kratiseon() { 
  return Syntelestis_Kratiseon; 
}
public int Akatharistos_Misthos(int Akat) {
 Akatharistos_Misthos = Akat;
 Akatharistos_Misthos = 2*3;
 return Akatharistos_Misthos;
}

}

class TestEmployee { 

  public static void main(String args[]) { 
    Employee Yp = new Employee("Nikos Nikas", "123456789", 25, 80.0 , 3.50f , 0.28f, 0);

    String name , AFM3;
    int Mer;
    double Hmero,Akatha2;
    float Ypero, Synt;
    
    
   
    

    name = Yp.getEponymia(); 
    AFM3 = Yp.getAFM();
    Mer = Yp.getMeres_Ergasias();
    Hmero = Yp.getHmeromisthio();
    Ypero = Yp.getYperories();
    Synt = Yp.getSyntelestisKratiseon();
    Akatha2 = 25 * 85+0.2 * 85 * 3.5;
        
    System.out.println("Onoma      = " + name ); 
    System.out.println("Afm   = " + AFM3 ); 
    System.out.println("Meres_Ergasias    = " + Mer );
    System.out.println("Hmeromisthio     = " + Hmero ); 
    System.out.println("Yperories   = " + Ypero );
    System.out.println("Syntelestis_Kratiseon = " + Synt);    
    System.out.println("Akatharistos = " + Akatha2);
}
}

Open in new window


Any help?
SOLUTION
Avatar of Robert Schutt
Robert Schutt
Flag of Netherlands image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Panos

ASKER

Hi robert_schutt
I changed getSyntelestisKratiseon() to getSyntelestis_Kratiseon()
Now i'm getting the following error:
C:\vaggelis\askisi1>javac newaskisi1.java
newaskisi1.java:79: error: cannot find symbol
    Synt = Yp.getSyntelestis_Kratiseon();
                  ^
  symbol:   method getSyntelestis_Kratiseon()
  location: variable Yp of type Employee
1 error
ASKER CERTIFIED SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Panos

ASKER

ok
i solved the problem,also line
public float Syntelestis_Kratiseon()
must be
public float getSyntelestis_Kratiseon()

thank you both for your help
Avatar of Panos

ASKER

robert_schutt
i missed your last comment.
Thank you
Avatar of Panos

ASKER

Thank you
regards
panos