• 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
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Sybex OCP 11 Programmer I. Chapter 10. Throwing and exception section. Potential typo

 
Ranch Hand
Posts: 53
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, Jeanne and Scott, I believe there can be a potential typo. I suppose you meant that exception is never instantiated without the new keyword

throw RuntimeException();   // DOES NOT COMPILE


Excerpt From: Boyarsky, Jeanne. “OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide”

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


Excerpt From: Boyarsky, Jeanne. “OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide”
 
Marshal
Posts: 74054
332
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorr for delay; I was busy yesterday. I think the grammar is correct; it means that the new keyword isn't used. Maybe it would be clearer to say, “...the keyword new isn't used,” or, “...the keyword new was omitted.”
 
author & internet detective
Posts: 40747
827
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
I agree with Campbell that the grammar is correct.
 
World domination requires a hollowed out volcano with good submarine access. Tiny ads are optional.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic