• 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:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

WHIZlabs scjp 1.4 simulator error?

 
Ranch Hand
Posts: 90
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi folks,

I have few doubts about WHIZlabs scjp 1.4 simulator. Today I was taking Practice Test 1. I think I found some errors. Due to them I was scored 54/61, while IMO it should be 56/61.
Do you agree with my comments below?

Q 44/61
Which of the following statements is correct with regard to threads?
A "Runnable" is a keyword within the Java language, used to identify classes which can exist as separate threads.
B "Runnable" is an interface, which classes can implement when they wish to execute as a separate thread.
C "Runnable" is a class, which classes can extend when they wish to execute as a separate thread.
D java does not support threads.
E None of the above.

Simulator says B is correct. Well, this was my first choice, but finally I've choosen E. In my opinion, the class must implement Runnable to be run as a separate thread. Can is not enough. Not the Thread implements Runnable.


Q 41/61
Which of the following can be used as a key of a HashMap or a HashTable
A int
B Object
C Char
D Integer
E Boolean
F Date

Answer: B,D,E,F. They say that "char" is not an Object. Well, char is not:-) but answer C was Char, not char. Definietly WHIZlabs error.



Q 40/61
Consider the following piece of code and select the correct statements:
.......
...
13. public void print()
14. {
15. System.out.println("Another test");
16. }
.....

One of the correct answers was:
Changing the code at line 13 to "public void print(int x) {" will allow the code to compile correctly.
It's obviously an error, as there would be two { chars - one at line 13, second at line 14.
Anyway, I choose one answer, simulator claims there are 2 correct answers, but gave me 1/1 point for this question anyway.



Q11/61 - I don't treat it as an error, but just as an question to you
Which of the following implement clear notion of one item following another (order)?
A List
B Set
C Map
D Iterator

Answer: "A is correct as list defines a framework for collections in sequence".
Isn't Iterator a better choice for one item following another, which in fact is [i]iterating[/b] ? Maybe I misunderstand the question, I'm not native English speaker.


PS. I'm taking Tiger SCJP this Thursday
 
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Q 44/61
Which of the following statements is correct with regard to threads?
A "Runnable" is a keyword within the Java language, used to identify classes which can exist as separate threads.
B "Runnable" is an interface, which classes can implement when they wish to execute as a separate thread.
C "Runnable" is a class, which classes can extend when they wish to execute as a separate thread.
D java does not support threads.
E None of the above.

Simulator says B is correct. Well, this was my first choice, but finally I've choosen E. In my opinion, the class must implement Runnable to be run as a separate thread. Can is not enough. Not the Thread implements Runnable.



Well in my opinion , whether Thread implements Runnable interface , but it is not your concern , you can create thread by two method :
1] extends Thread class .
2] implements Runnable interface .
So can is proper ...
 
ankur rathi
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Best of luck to you for Tiger ...
I am taking it on friday . How is your preparation . Can you share with me , how you are preparing ...
Thanks .
[ March 01, 2005: Message edited by: rathi ji ]
 
Ranch Hand
Posts: 1392
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Adam,

As JDK 1.5 supports autoboxing/unboxing, primitive values like int, char, etc can now be used as a key of HashMap or HashTable. So answers for 1.4 may not be valid in 5.0.

Best of luck for your beta exam.

Joyce
 
Joyce Lee
Ranch Hand
Posts: 1392
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And best of luck to you too, Rathi.
 
drifter
Posts: 1364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Q 41/61
Which of the following can be used as a key of a HashMap or a HashTable
A int
B Object
C Char
D Integer
E Boolean
F Date

Answer: B,D,E,F. They say that "char" is not an Object. Well, char is not:-) but answer C was Char, not char. Definietly WHIZlabs error.



primitive is char, but the wrapper class is Character not Char.
 
Adam Czysciak
Ranch Hand
Posts: 90
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by rathi ji:
Well in my opinion , whether Thread implements Runnable interface , but it is not your concern , you can create thread by two method :
1] extends Thread class .
2] implements Runnable interface .
So can is proper ...



However, Thread implements Runnable by inheritance. I think that question shouldn't be based on your code typing, but on the Objects flow. In this case, there always must be Runnable implemented.
 
ankur rathi
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Joyce ,
can you please give me answer of one question ( because you have taken beta ) , I never read IO section , And it is not looking possible for me to read that whole chapter ( it is very big chapter ) , so can you tell me how much it may affect the score ( how many question may come from this section ) ...

Can any body please give me any link where it is explained in short & simple way ...

Thanks a lot .
 
Adam Czysciak
Ranch Hand
Posts: 90
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by rathi ji:
Best of luck to you for Tiger ...
I am taking it on friday . How is your preparation . Can you share with me , how you are preparing ...
Thanks .



Thanks. I use K&B for Java 1.4, but imho it's not enough. Too low API details I think. And of course no 5.0 features. I strong base on beta exam objectives from Sun, tutorials from IBM's developer works (http://www-130.ibm.com/developerworks), tutorials from Sun documentation (about new 5.0 features). I saw developer's notebook, but somehow I didn't like it too much. K&B's language is much better for me. Plus, of course, about 3 years java practice now. Although, when heard of SCJP, I imagined there are a lot of things not known yet... my Java knowledge base increased a lot while preparing for SCJP Ah, and of course, I look from time to time to JLS 3, but it's very formal... so it's not number one. And - did I mention javadocs?
 
ankur rathi
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Adam ,
It is like this sentance ,

you can log-in on javaranch , if you want to post any question .

So if you will change it like this :

If you want to post any question then you can log-in on javaranch .

then you are right , must is proper .


but in this original one can is proper :

you can log-in on javaranch , if you want to post any question .

hope it is right ...
 
Adam Czysciak
Ranch Hand
Posts: 90
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Carol Enderlin:
primitive is char, but the wrapper class is Character not Char.



Ah, sure! Right... how could I misread it? Thanks, Carol!
 
And will you succeed? Yes you will indeed! (98 and 3/4 % guaranteed) - Seuss. tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic