File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Problem recognizing incompatible types error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Problem recognizing incompatible types error" Watch "Problem recognizing incompatible types error" New topic
Author

Problem recognizing incompatible types error

Brian Mart
Ranch Hand

Joined: Apr 17, 2012
Posts: 34
Hi everyone! I am working on this code that accepts six grades from a GUI, drops the lowest grade and then gives the final grade. However, when I make an array of doubles to store the grades, my compiler tells me that there are incompatible types. What am I missing here? I only use doubles up until that point of the code, so this is really confusing me. Infinite thanks in advance for any help. The problem is highlighted on like 38 here.

Greg Brannon
Bartender

Joined: Oct 24, 2010
Posts: 561
On the left side of the declaration,

double grades

grades is a single variable of type double. However, on the right side, the variable grades is assigned to a 5-element array of type double. Recheck the declaration of array variables and see if you can fix this simple syntax error.


Always learning Java, currently using Eclipse on Fedora.
Linux user#: 501795
Brian Mart
Ranch Hand

Joined: Apr 17, 2012
Posts: 34
...wow. It was a long day yesterday. Thanks for getting my brain to turn on again!
Greg Brannon
Bartender

Joined: Oct 24, 2010
Posts: 561
Sometimes the easy errors are the hardest to see without a little help. Glad I could.
 
Don't get me started about those stupid light bulbs.
 
subject: Problem recognizing incompatible types error