wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes what is up with suns sample test 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 "what is up with suns sample test" Watch "what is up with suns sample test" New topic
Author

what is up with suns sample test

daniel schulken
Ranch Hand

Joined: Sep 23, 2000
Posts: 34
question 8
1.import java.awt.*;
2.
3. public class Test extend Frame {
4. public Test() {
5. add( new Label("Hello") );
6. add( new TextField("Hello") );
7. add( new Button("Hello") );
8. pack();
9. show();
10. }
11. public static void main(String args[]) {
12. new Test();
13. }
14.}
now the answers could be
A.The code will not complile.
B.A window will appear containing only a Button.
C.An IllegaArgumentException is thrown at line 6.
D.A window will appear but will not contain the Label, TextField, or Button.
E.A window will appear containing a Label at the top, a TextField below the Label, and a Button below the TextField.
F.A window will appear containing a Label on the left, a TextField to the right of the Label, and a Button to the right of the TextField .

there answer is B however i selected A bescause there is no extend keyword!
then on question 1

1. Given:
1.public class ArrayTest {
2. public static void main (String[] args) {i
3. Object[] ov;
4. String[] sa = { "Green", "Blue", "Red" };
5. ov = sa;
6. System.out.println("Color = " + ov[1];
7. }
8.}
What is the result?
A.fails to compile
B.prints Color=Blue
C.prints Color=Green
D.generates an exception at runtime
i choose A because it can not compile however sun says its B
I really hope the new test does not have errors like this.
Viji Bharat
Ranch Hand

Joined: Sep 18, 2000
Posts: 101
Good observation Daniel. Sun should be notified of the errors in the new set of sample questions. There are 3 typos in 10 questions!!
Mapraputa Is
Leverager of our synergies
Sheriff

Joined: Aug 26, 2000
Posts: 10065
Exam: 310-025 Sun Certified Java programmer
Candidate: Sun Inc.
Result: passes with 80%


Uncontrolled vocabularies
"I try my best to make *all* my posts nice, even when I feel upset" -- Philippe Maquet
Jane Griscti
Ranch Hand

Joined: Aug 30, 2000
Posts: 3141
LOL ... you were generous Mapraputa ... I'd give them 70%
Jane


Jane Griscti
SCJP, Co-author Mike Meyers' Java 2 Certification Passport
daniel schulken
Ranch Hand

Joined: Sep 23, 2000
Posts: 34
LOL

i thank the maxium that they could get would be 70
Mapraputa Is
Leverager of our synergies
Sheriff

Joined: Aug 26, 2000
Posts: 10065
Friends, be fair, they answered 8 questions correct. Or I missed something... 80% are good scores, although comparing to many on this site, hmmm, not so great... Sun should probably visit Java ranch more often...
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: what is up with suns sample test
 
Similar Threads
Sun Sample queston #1
Sun Sample question: 8
doubt in new exam question
JMenu Problem
answer to question no8 of sample questions is wrong