This week's book giveaway is in the JDBC forum.
We're giving away four copies of Make it so: Java DB Connections & Transactions and have Marcho Behler on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Scjp Exam questions.  Please help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Scjp Exam questions.  Please help" Watch "Scjp Exam questions.  Please help" New topic

Scjp Exam questions. Please help

lakshmi Nanda

Joined: May 13, 2007
Posts: 5
Hi I am new to Software Indus. I wrote SCJP 1.5 Exam. I got these qest. Can anybody help me. Thanks in advance.

1. static final int a[];
static {
a[0] =2;
What Exception will it throw?
The options given are :
c.some exceptions
d.some exceptions

I think this code will cause a compiler error. But There is no compiler error in the options.

2.public class a{

//some code
public class aa implements Runnable{

//some code which produces some numerical output


What is the output ?

There is no compiler error in the option.

I think there shouldn't be more than one public class def. in a file. right?

3.class A {

void somemethod(){


class B extends A

void somemethod(){

What is the output when somemethod() called?

In the question they didn't mention how the somemethod() is called like

A a = new A();


A ab = new B();



B b = new B();


If Iam wrong please correct me. thanks .
Also What is the best way to prepare for the Drag and Drop questions. I got many of them.
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Please read this carefully

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Deepak Jain
Ranch Hand

Joined: Aug 05, 2006
Posts: 637
All the answers seem to be correct, What has confused you then??

lakshmi Nanda

Joined: May 13, 2007
Posts: 5
Hi Barry

Thanks for the advise. I understand.

I only gave the similar ones not exactly the same questions. In order to explain my doubts clearly.

Can I still dicuss about the topics, as general java doubts.


I agree. Here's the link:
subject: Scjp Exam questions. Please help
jQuery in Action, 3rd edition