SCJP Practice questions – 1

Share this Article :


Objective 4.3)
1)double
4)instanceof

Note the upper case S on switch means it is not a keyword and the word then is part of Visual Basic but not Java. Also, instanceof looks like a method but is actually a keyword,
________________________________________
Answer 37)
Objective 9.2)
4) -3.0
________________________________________
Answer 38)
Objective 4.2)
3) one
Command line parameters start from 0 and fromt he first parameter after the name of the compile (normally Java)
________________________________________
Answer 39)
Objective 10.1)
4) The set is designed for unique elements.
Collection is an interface, not a class. The Collection interface includes a method called iterator. This returns an instance of the Iterator class which has some similarities with Enumerators.
The name set should give away the purpose of the Set interface as it is analogous to the Set concept in relational databases which implies uniquness.
________________________________________
Answer 40)
Objective 8.1)
2) If multiple listeners are added to a component the events will be processed for all but with no guarantee in the order
4) You may remove as well add listeners to a component.
It ought to be fairly intuitive that a component ought to be able to have multiple listeners. After all, a text field might want to respond to both the mouse and keyboard
________________________________________
Answer 41)
Objective 5.1)
1) b=m;
3) d =i;
You can assign up the inheritance tree from a child to a parent but not the other way without an explicit casting. A boolean can only ever be assigned a boolean value.
________________________________________
Answer 42)
Objective 7.3)
2) You can obtain a mutually exclusive lock on any object
3) A thread can obtain a mutually exclusive lock on a method declared with the keyword synchronized
4) Thread scheduling algorithms are platform dependent
Yes that says dependent and not independent.
________________________________________
Answer 43)
Objective 6.1)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

Written by bhaskar

{bhaskar has written 11 posts on ITTreats.com . See all posts by }


Leave a Reply