Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Scjp Exam questions. Please help

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please read this carefully
 
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All the answers seem to be correct, What has confused you then??
Thanks
Deepak
 
lakshmi Nanda
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic