• 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
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

error step by step

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


this program contains 3 error but shows only one
at 1st time compiler will say to put ;
after correction of this error shows illegal combination of modifier error
again after correction of this error , shows main method not found

i want to know that
how we can determine there is only 1 error at first time compilation instead of this 3 error.............
 
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Compiler stops the compilation process at the point where a compiler error is see. So as you go ahead correcting the errors, the next/newer errors are reported.
 
gaurav gupta sitm
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
there are many program in which compiler shows all error at same ........
but why only in this program compilation methodology is change ???
 
Mohamed Sanaulla
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

gaurav gupta sitm wrote:there are many program in which compiler shows all error at same ........
but why only in this program compilation methodology is change ???



Ok, I might be wrong Never keenly observed it though.
 
Ranch Hand
Posts: 173
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe that compilation is always a complicated process...
There may be some situations that compiler cant proceed further ...
and some other scenarios which are completely independent.

And we have a course on Compilers in this semester at our college...
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Doing some experimenting, it appears it goes through several passes and if one or more errors are found in one pass, then it does not continue with any further passes.

See this example:

If you compile it, you will get three errors at once, and they are all syntax errors because of missing semicolons. If you correct the three missing semicolons and compile again, then you will get two different errors relating to the mistyped System class and the combination of final and abstract.

So it appears that it makes a first pass checking purely for basic syntax errors that would invalidate the program and if found there is no point in continuing the compilation process. If no errors are found it proceeds with the next phase.

This is all just guessing on my part of course. Hareendra, hopefully you will learn more about these mysteries in your Compilers class.
 
This parrot is no more. It has ceased to be. Now it's a tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic