• 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

Mock exam question

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
#1 Which can not be used in declaring or declaring and initializing an automatic variable?
1) final
2) static
3) constants non-primitive type
4) inner classes from other scopes
5) initialized arrays(such as {"Hello","Goodbye"})
#2 Which best describes the requirements fo a fully encapsulated class ?
a) Method are all privates
b) Instance variables are all private
c) No methods or variable are static
d) Methods are all public while instance variable are all default or private
e) Methods are public, protected, default or private access while instance variables are only public

Could someone kindly answer the above questions with brif explanations?
thank you!
 
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I suppose for the second question related to a fully encapsulated class it should be
d) Methods are all public while instance variable are all default or private
 
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think the answer for
#1 - 2 and 3
#2 - b and d
Thanks
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic