• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

two puzzling errors

 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is a lab problem for class. I don't understand the two errors at compilation. The error messages:





I also don't understand why the lab requires moreData() to have a String formal parameter.
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The moreData method does not seem to use any parameters, so I would remove the argument. If you do leave it in, then the type needs to be specified -- which is what the compiler is complaining about. (Note that the method is called with a String.)

The isLeap method also requires a type for its argument. (And the first println in that method is missing a closing parenthesis.)

Now, here's a big mistake that everyone makes at least once: A single equals sign is used for assignment (=). Two equals signs are required for comparison (==).
[ February 04, 2006: Message edited by: marc weber ]
 
Jesse Crockett
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
now I get the logical errors. I thought you were joking.
 
marc weber
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jesse Crockett:
now I get the logical errors. I thought you were joking.


Ah, yes... The wink was meant as, "Just something to keep in mind, because we've all done that before."
[ February 04, 2006: Message edited by: marc weber ]
 
money grubbing section goes here:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic