• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

Possible inaccuracy in Sybex CSG 17 - Page 597 - Use of new keyword

 
Greenhorn
Posts: 19
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On page 597 is the following paragraph:

The exam might also try to trick you. Do you see why this code doesn’t compile?

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



The last sentence should read:

The exception is never instantiated without the new keyword.

 
author & internet detective
Posts: 41995
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This seems like an English thing> Both sound right to me.

It's never instantiated with the new keyword, therefore it is never instantiated.

vs
It's never instantiated without the new keyword because the key word is missing.
 
Marshal
Posts: 28305
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would have found "It's not instantiated with the new keyword, therefore it is never instantiated" a bit more comprehensible, so I would vote for the second version.
 
Marshal
Posts: 5578
326
IntelliJ IDE Python TypeScript Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm sure if we had n people comment on this topic we would have n different, and likely correct, ways to say the same thing.

However, since this is proposing a "correction" to a body of work released in physical print form (a paper book) I propose that no correction is needed since the original statement "The exception is
never instantiated with the new keyword" is technically correct. Perhaps the phrasing isn't to everybody's taste, but it's not incorrect.
 
No one can make you feel inferior without your consent - Eleanor Roosevelt. tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic