• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Abstract classes and overloading methods .. getting errors please help!!

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Everyone,

I have put all my .java files in the same folder.

I am trying to overload a method and pass the required parameters in a different class and am getting following error when trying to compile my EmployeeFormat.java file

My Code:

//Person.java



// Employee.java



//Code for GenericFormat.java


// Code for EmployeeFormat.java



Can anyone please let me know what is my mistake ?? Why am I getting an error when trying to compile the EmployeeFormat.java file?? Any help is appreciated.

Thank you!!
 
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Compiler error clearly states what's going wrong. Did you try to find out what the compiler states? Please check the formatObj() function signature in GenericFormat class and the one you are trying to invoke in EmployeeFormat class.
 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you are passing the parameters to the function incorrectly.

Also when referring to a static data put the class name before: EmployeeFormar.emplTypeWidth1

 
Divya Kotamraju
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Alex and Mohammed . I could figure out my mistake and it is running fine now.

Thank you once Again!!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic