Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

OCP JSE6 question

 
henry joe
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello guys,

I have a question that goes like this :



which are true?

A. Compilation fails
B Class BeSafe can create many instances of SafeDeposit
C Class BeSafe CANNOT create any instances of SafeDeposit
D Class BeSafe can create only one instance of SafeDeposit
E Class BeSafe can create instances of SafeDeposit without using the getInstance() method
F Once class BeSafe has created an instance of SafeDeposit, it cannot change the value of the instance's " code" variable.

The answer given were B and F but why?
 
Montgomery Buslingthorpe
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Henry,

the same question has been asked and answered here : http://www.coderanch.com/t/541410/java-programmer-SCJP/certification/SCJP-creation-singleton
 
Anayonkar Shivalkar
Bartender
Posts: 1557
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@ henry joe,

Welcome to CodeRanch!

As Pi Xel has suggested, please SearchFirst.

@ Pi Xel,

Please go through naming policy here.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic