wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes constructor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "constructor" Watch "constructor" New topic
Author

constructor

Netty poestel
Ranch Hand

Joined: Sep 20, 2004
Posts: 131
Dan chisholm:-
Question 2
Which of the following modifiers can be applied to a constructor?

a. private
b. abstract
c. final
d. volatile
e. native
f. None of the above.

Ans. in Dan = a private

K & B states = � Rules for Constructors
The following list summarizes the rules you�ll need to know for the exam (and to understand the rest of this section):
� Constructors can use any access modifier, including private.

Now where does this leave us wannabees .....?
Kathy Sierra
Cowgirl and Author
Ranch Hand

Joined: Oct 10, 2002
Posts: 1572
Howdy!
There are *modifiers* and there are *access modifiers*. So, things like native, abstract, etc. are modifiers, but ACCESS modifiers are only
* private
* public
* protected

We say that there are four access LEVELS:
* private
* default
* protected
* public

(in order of restrictiveness)

but only THREE access MODIFIERS, since you can' use "default" as a modifier.

Does that help?

A lot of people at first find modifiers vs. access modifiers confusing since other modifiers can affect access in some ways (like "final"), but only the three modifers directly related to accessibility/visibility are considered "access" modifiers.

cheers,
Kathy
Netty poestel
Ranch Hand

Joined: Sep 20, 2004
Posts: 131
Wow !
mail reply straight from 'THE' 'Cowgirl'.
Thanks Kathy, there remains no iota of an argument here.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: constructor
 
Similar Threads
Private Constructor
Marcus Green Constructor Q doubt?
Constructor
constructors