This week's book giveaways are in the iOS and Features new in Java 8 forums.
We're giving away four copies each of Barcodes with iOS: Bringing together the digital and physical worlds and Core Java for the Impatient and have the authors on-line!
See this thread and this one for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Mock Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Barcodes with iOS this week in the iOS forum
or Core Java for the Impatient in the Java 8 forum!

JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Mock Question" Watch "Mock Question" New topic
Author

Mock Question

Higgledy Smith
Ranch Hand

Joined: Mar 07, 2006
Posts: 192
This is a question from the K&B SCJP Study Guide 6.0 1st mock exam.

What is the point of this question? Are the test makers trying to test constructors or access modifiers?


Given:

Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14589
    
  24

Higgledy Smith wrote:This is a question from a mock exam.

Which mock exam? Please note that we require you to quote your sources, and just saying "a mock exam" is not good enough.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Higgledy Smith
Ranch Hand

Joined: Mar 07, 2006
Posts: 192
Jesper Young wrote:
Higgledy Smith wrote:This is a question from a mock exam.

Which mock exam? Please note that we require you to quote your sources, and just saying "a mock exam" is not good enough.


Fixed. Sorry.
Ruben Soto
Ranch Hand

Joined: Dec 16, 2008
Posts: 1032
Higgledy Smith wrote:This is a question from the K&B SCJP Study Guide 6.0 1st mock exam.

What is the point of this question? Are the test makers trying to test constructors or access modifiers?

What's the question, again? I only saw some code. From looking at it, I guess the point is that if the constructor in the superclass had been private then the code wouldn't compile.


All code in my posts, unless a source is explicitly mentioned, is my own.
Welly Tambunan
Ranch Hand

Joined: Aug 18, 2008
Posts: 40
Higgledy Smith wrote:This is a question from the K&B SCJP Study Guide 6.0 1st mock exam.

What is the point of this question? Are the test makers trying to test constructors or access modifiers?


Given:


Based on my opinion. That's trying to test both.
Imagine if the class both resides in the different package.
That would be compile error.
Because constructor in superclass cannot be accessed outside its package.

is that right?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Mock Question