SCJP 6
SCJP 6 - 91%
<><
Programmatically thrown in the sense not explicitly throwing the error in the program. It means an exception or error caused solely because of your program at runtime.
SCJP 6
Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
All code in my posts, unless a source is explicitly mentioned, is my own.
SCJP 6
Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
All code in my posts, unless a source is explicitly mentioned, is my own.
All code in my posts, unless a source is explicitly mentioned, is my own.
'coz you are forcing the error to happen at a particular point and is basically used for debugging and stuff, rite??
SCJP 5.0 - JavaRanch FAQ - Java Beginners FAQ - SCJP FAQ - SCJP Mock Tests - Tutorial - JavaSE7 - JavaEE6 -Generics FAQ - JLS - JVM Spec - Java FAQs - Smart Questions
Bert Bates wrote:I'd really like to hear other opinions
Dennis Deems wrote:It's not like a Stack Overflow or an Illegal State.
Ryan Slominski wrote:As was already pointed out you can make the same argument with NullPointerException (which is reportedly thrown by the JVM):
vs
Ryan Slominski wrote:The argument for the programmatic camp appears to be that the application developer has a certain amount of control over an AssertionError; In other words the application developer can choose to include AssertionErrors or leave them out (or turn them off at runtime).
Ryan Slominski wrote:
Dennis Deems wrote:It's not like a Stack Overflow or an Illegal State.
Not sure what you mean; StackOverflowError is an Error thrown by the JVM and IllegalStateException is an Exception thrown programmatically.
Dennis Deems wrote:You would never write that code in real life
Dennis Deems wrote:A NullPointerException will happen any place the code calls a method on a null object, regardless of the programmer's wishes
Morteza Manavi-Parast wrote:While in the K&B SCJP 6 book on page 382 mentioned that AssertionError is thrown Programmatically, I found this to be thrown by JVM according to other sources. I personally think the source of this Error is JVM since this is the JVM who throw the Error when assertion is enabled and the assert expression is evaluated to false. I checked the javadoc and JLS for assertion error and could not find any explicit statement about whether it thrown by JVM or programmer. So is it a mistake in the book or it really thrown by programmer?
OCPJP6-05-11
"Your life is in your hands, to make of it what you choose."
OCPJP 6.
In Your Pursuit Towards Certification, NEVER Give Up.
He baked a muffin that stole my car! And this tiny ad:
Low Tech Laboratory
https://www.kickstarter.com/projects/paulwheaton/low-tech-0
|