Win a copy of High Performance Python for Data Analytics this week in the Python forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Throwing an exception - Sybex CSG 11 p.410 Kindle Edition

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

Boyarsky, Jeanne; Selikoff, Scott. OCP Oracle Certified Professional Java SE 11 Developer Complete Study Guide (p. 410). Wiley. Kindle Edition.

this excerpt:
---

If your answer is that there is a missing keyword, you’re absolutely right. The exception is never instantiated with the new keyword.
---

I don't understand how the exception is never instantiated with the new keyword. If an exception is going to be instantiated, it is most likely going to be instantiated with the new keyword? Right?



 
Marshal
Posts: 71760
312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Unless you have a method somewhere called RuntimeException() which returns some sort of exception, you would have to regard that code as having a syntax error. Does the explanation say the keyword new is missing?
 
Rade Koncar
Ranch Hand
Posts: 41
1
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh, I get it now, The sentence "The exception is never instantiated with the new keyword." is not a fact, like "you must never instantiate it with a new keyword".
It should be observed in the context of the previous sentence.

Right, that makes sense, thanks.

Btw a method called RuntimeException()?   Wasn't see that coming...
 
Campbell Ritchie
Marshal
Posts: 71760
312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rade Koncar wrote:. . , The sentence "The exception is never instantiated with the new keyword." is not a fact, like "you must never instantiate it with a new keyword". . . .

I am not quite sure I understand that sentence.

Btw a method called RuntimeException()?   Wasn't see that coming...

Hahahahahahahahaha! It is always possible to throw in surprises.
 
Rade Koncar
Ranch Hand
Posts: 41
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So the text:
If your answer is that there is a missing keyword, you’re absolutely right. The exception is never instantiated with the new keyword.

Should be read like this:
If your answer is that there is a missing keyword, you’re absolutely right. The exception we are talking about in the example is never instantiated with the new keyword.

And not like this:
If your answer is that there is a missing keyword, you’re absolutely right. You must never instantiate the exception with the new keyword.


I was a bit too literal
 
Campbell Ritchie
Marshal
Posts: 71760
312
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think the current text is all right, but I might prefer to say

The keyword new is missing,

...and leave it at that.
 
Ranch Foreman
Posts: 175
8
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Campbell:

I have worked with countless brilliant people from all over the world who would have been confused in the same way the OP was by the original text and would never have been confused by your simpler re-wording.  I am very picky about wording things both precisely, and in ways that avoid common alternate meanings or connotations in dialects of English other than American.  I've posted about a number of them.
 
Campbell Ritchie
Marshal
Posts: 71760
312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jesse Silverman wrote:. . . your simpler re-wording. . . .

Thank you
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic