aspose file tools*
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
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Scjp Exam questions.  Please help" Watch "Scjp Exam questions.  Please help" New topic
Author

Scjp Exam questions. Please help

lakshmi Nanda
Greenhorn

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 :
a.staticIntializationExcetpion
b.statkOverFlowError
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.somemethod();

or.

A ab = new B();

ab.somemethod();

or.

B b = new B();

b.somemethod().

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??
Thanks
Deepak


SCJP, SCWCD, SCBCD
lakshmi Nanda
Greenhorn

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.

Thanks

Lakshmi
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Scjp Exam questions. Please help