• Post Reply Bookmark Topic Watch Topic
  • New Topic

Help with assigning Array Size  RSS feed

 
Peter Kolozvary
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What the heck is the problem?



The error I'm getting is Salaries.java:33: incompatible types
found : java.lang.Double
required: int
 
Muhammad Saifuddin
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EMPLOYEES is double type variable.. for declaring the array size.. you need to pass int data type.



now see this error again..

Salaries.java:33: incompatible types
found : java.lang.Double
required: int


hope it helps.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not Integer.parseInt()?
 
Peter Kolozvary
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, I took a different route and have another question.

I need to Display the Names and Salaries of all Employees that are higher than the Average. I have included the code which shows how to display the highest salary of them all but am having trouble figuring out how to display this for each employee.

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!