• 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

compiler some times does NOT report all errors

 
Ranch Hand
Posts: 787
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

The compiler (1.4) gives error at line 1 only. Line 2 & 3 are ignored. However, if you resolve line 1 error, 2 & 3 are reported. Any reasons for that behavoir?
Thanks
Barkat
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
B'coz Java is an interpreted language.
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If there's more than one error possible, the compiler isn't required to report them all. Compilaion is a multi-pass process, and generally the compiler will report all errors it finds in a given pass, but then it will stop. So it tends to find all errors of a given general "type", but ignore the more complex stuff it hasn't gotten around to understanding yet. Which things it reports and which it does not is a complex thing to determine, but it's not one you need to worry about for SCJP. If the compiler could report a given error (assuming no other errors cause compilation to complete prematurely), that's all you really need to know.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic