Results 1 to 4 of 4
  1. #1
    makpandian's Avatar
    makpandian is offline Senior Member
    Join Date
    Dec 2008
    Location
    Chennai
    Posts
    450
    Rep Power
    7

    Default Diference Between compiler error Garbage collection and Runtime Error?

    Hello java lovers
    ......................
    i am mak .i have one big thread in my mind about java programming?
    i don't know how java errors are classified into compiler error ,garbage and Runtime error?
    any one can explain about that in simple manner?


    Regards
    makpandian.

  2. #2
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Default

    Don't consider gc, I tested it recently - it should be removed from api.

    Compiler errors are things you are told about when you try to write the code, runtime errors ( and exceptions ) are things that error while the program is ( supposed to be ) running.
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  3. #3
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    8

    Default

    Garbage collection is something the runtime does in the background, which reclaims unused memory. It has nothing to do with errors.

    Compiler errors are generated when the compiler takes your source and attempts to turn it into byte codes. If error occur, then the compile process fails.

    Exceptions are errors that occur while the program is running. Normal exceptions are things that the programmer anticipated and must explicitly either handle or say that the method will not handle them. Normal exceptions are things like "Connection refused by host". The programmer knew that the host could refuse the connection, so explicitly declares an exception for it.

    Runtime exceptions are special exceptions that the programmer did not anticipate. "Null pointer exception" is a good example.

    One note: In a block, only normal (not runtime) exceptions will be caught. If you want to catch *everything*, use try{} catch(Throwable t) {}.

    Look at the API for Throwable, Exception, and RuntimeException.

  4. #4
    makpandian's Avatar
    makpandian is offline Senior Member
    Join Date
    Dec 2008
    Location
    Chennai
    Posts
    450
    Rep Power
    7

Similar Threads

  1. Help Finding Compiler error solution please
    By jamesr2b in forum New To Java
    Replies: 5
    Last Post: 04-30-2009, 07:07 AM
  2. How setting an Object to null help Garbage Collection?
    By piyu.sha in forum Advanced Java
    Replies: 3
    Last Post: 10-06-2008, 08:35 AM
  3. Compiler Error
    By jeneal in forum New To Java
    Replies: 5
    Last Post: 12-13-2007, 02:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •