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

constructor

 
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 .....?
 
Cowgirl and Author
Posts: 1589
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 131
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wow !
mail reply straight from 'THE' 'Cowgirl'.
Thanks Kathy, there remains no iota of an argument here.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic