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

Exceptions created as member classes of package

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

My assignment states:

"Any unimplemented exceptions in this interface must all be created as member classes of the suncertify.db package"

Call me dim, but this statement is confusing me.

A member class is surely a member of a class not a package.

Cheers,

Simon
 
Simon Cockayne
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
...and by the way...

I interpeted the instructions to mean:

1) Create RecordNotFoundException.java under suncertify.db that declares

class RecordNotFoundException extends Exception {...}

and

2) Create DuplicateKeyException .java under suncertify.db that declares

class DuplicateKeyException extends Exception {...}

Si
 
Simon Cockayne
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Answered my own question.

JLS
http://java.sun.com/docs/books/jls/first_edition/html/6.doc.html#34993

states:

"A member of a package (�7) is a subpackage (�7.1), or a class (�8) or interface (�9) type declared in a compilation unit (�7.3) of the package."

So exception "created as a member class of a package", would simply be declared as a class in the package (not as a member of another class within that package)

right?


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

So exception "created as a member class of a package", would simply be declared as a class in the package (not as a member of another class within that package)



Yes, that's how I would interpret it. That is, if you want your own "RecordNotFoundException" class then stick it in the suncertify.db package.
 
No matter. Try again. Fail again. Fail better. This time, do it with this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic