aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes SCJP 5 Questions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "SCJP 5 Questions" Watch "SCJP 5 Questions" New topic
Author

SCJP 5 Questions

Sundeep Gupta
Greenhorn

Joined: Feb 28, 2006
Posts: 13
Hi all,

I have few unsolved questions. Could anyone please provide me with answers. I'm writing the exam within 2 days. Plz reply ASAP.

Here goes the list.............

Question 1 :

Encapsulation involve separating the interface of class from implementation. Yes or No.

Question 2 :

wait() and notify() methods are defined in Thread class ? Yes or No?

I knew that they are in Object class but Thread itself extends Object so they are available in Thread class too.
What should be my answer Yes or No?

Question 3:
following regular expression will match non digit character "\D". True or False ?

I'm confused coz, "\D" is evaluated as non-available escape sequence (Error) whereas "\\D" is correct. If so answer is False.

Correct me if i'm wrong.


Thanks
Sundeep


SCJP 5.0
Mikalai Zaikin
Ranch Hand

Joined: Jun 04, 2002
Posts: 3233
    
    7
Originally posted by Sundeep Gupta:


Question 2 :

wait() and notify() methods are defined in Thread class ? Yes or No?

I knew that they are in Object class but Thread itself extends Object so they are available in Thread class too.
What should be my answer Yes or No?



Answer: No

Object class defines those methods
Thread class inherits those methods

regards,
MZ


Free SCDJWS 5.0 Study Guide - SCDJWS 5.0 Quiz (How to get SCDJWS 5.0 Quiz)
Java Platform, Enterprise Edition 6 Web Services Developer Certified Expert Exam Study Guide and Quiz
Sundeep Gupta
Greenhorn

Joined: Feb 28, 2006
Posts: 13
But in one of the mock exam (A.K Gupta's exam)it is stated that they are in Thread class. The problem was like this :

Which of the methods are defined in Thread class :

a. wait()
b. notify()
c. terminate()
d. yield()
e. sleep()

and answer was a, b, d, and e. Is this correct or d,e is the correct answer ?

Thanks
Sundeep
Marcus Green
arch rival
Rancher

Joined: Sep 14, 1999
Posts: 2813
I recommend taking a look at the official documentation to get a definitive answer to this question. Try the following links.

http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Thread.html


SCWCD: Online Course, 50,000+ words and 200+ questions
http://www.examulator.com/moodle/course/view.php?id=5&topic=all
 
 
subject: SCJP 5 Questions