This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes OCP JSE6 question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "OCP JSE6 question" Watch "OCP JSE6 question" New topic

OCP JSE6 question

henry joe

Joined: Jul 24, 2012
Posts: 16
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

Joined: Jul 24, 2012
Posts: 4
Hi Henry,

the same question has been asked and answered here :
Anayonkar Shivalkar

Joined: Dec 08, 2010
Posts: 1502

@ henry joe,

Welcome to CodeRanch!

As Pi Xel has suggested, please SearchFirst.

@ Pi Xel,

Please go through naming policy here.

Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
subject: OCP JSE6 question
Similar Threads
SCJP creation of singleton question
Constructors in a class
what is the use of this " static A a = new A() "
Question regaring Singleton.