File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Mock Questions 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 "Mock Questions" Watch "Mock Questions" New topic
Author

Mock Questions

Venkat Ramanan
Ranch Hand

Joined: Jan 25, 2001
Posts: 30
Hi there,
last night i took a mock test from IBM site.... for the following questions, my answers went wrong because
1) Which of the following declarations of a top-level class Frog are legal, assuming Animal is an existing class?

a) protected class Frog extends Animal {

b) private class Frog extends Animal {

c) transient class Frog extends Animal {

d) native class Frog extends Animal
// here none of the option will fit in for top-level classes.... then what s the use of asking me to select the correct option. Please explain?
2) The following are true of Java character-oriented streams:

a) They provide support for character conversion between Unicode and ASCII

b) They all implement the CharacterStream Interface

c) They inherit from either the Reader or Writer abstract classes

d) They are restricted to 2^16 (2 raised to power of 16) in length
//Please explain Java character-oriented streams... will there be a question on this in SCJP exam?
3) With respect to User and Daemon threads:

a) Daemon threads can not be destroyed

b) Running User threads prevent a JVM from terminating program

c) Running Daemon threads prevent a Java VM from terminating program

d) Daemon threads can not be grouped together

e) The JVM can terminate program when only daemon threads are running
// What are the correct options here? can deamon threads be grouped together?
4) An object should be thought of as:

a) A template for creating similarly behaving things

b) A data holder only

c) A mold that can be reused to mold additional things

d) An entity which combines data and functions on that data to create behavior

e) A place, like a file, to store related methods and no data
// This one is little confusing .... kly explain....
5) Given that a java.io.IOException might occur when calling the read() method of the BufferedInputStream, you can handle the exception by:

a) Catch a java.io.EOFException using a try/catch clause.

b) Catch a java.lang.Exception using a try/catch clause.

c) Listing a java.io.EOFException in a throws list.

d) Catch the java.lang.Exception using the throw statement.
// Can i catch a java.io.EOFException using a try/catch clause when java.io.IOException might occur. what is the correct answer?
6) Given an object design where the Person class is the superclass of the Employee class, which of the following statements best describes this relationship?

a) aggregation

b) "is a"

c) "has a"

d) polymorphism

e) independence

// What is this "is a" "has a" here???

Sorry for troubling friends!!!
Venky
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
WOW, I am a bit overwhelmed here. Perhaps splitting this into 5 posts would be better. However I will start with the last one.
An Employee "is a" Person. To be a sub-class you must be able to say all Employees are Persons. However you can not necessarily say all Persons are Employees.
The "has a" relates to variables. If the Person class has a variable called name you can say a Person "has a" name.
Try reading this: http://www.javaranch.com/ubb/Forum24/HTML/006942.html


"JavaRanch, where the deer and the Certified play" - David O'Meara
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Wow,
Long post, just about fell asleep reading it ...
I can help with a few the others don't ask questions or my small mind can't see the question!
1. None is a valid answer. The question doesn't tell you to choose one. It asks you which of the following ... Here is a real world analogy: We have three cars colors purple, light green, and bright yellow. I ask you: "Which of these cars would you like to drive off the brooklyn bridge?
4. An object should be thought of as (d). A place for data and methods that define related behavior.
5. A java.io.IOException is a subclass of java.lang.Exception so we can use that to catch it. We can only use a try/catch block because throw is not catching it. We can of course throw it again once we catch it...
6. Cindy's answer looks good to me!
Regards,
Manfred.
Hungson Le
Ranch Hand

Joined: Jan 25, 2001
Posts: 32
Venkat,
Could you please give me a link to the IBM mock exam? I'd like to try them.
Thanks,
LHS


Hungson Le<BR>
natarajan meghanathan
Ranch Hand

Joined: Feb 01, 2001
Posts: 130
1) I took the IBM mock exam and it just says to you select. I didn't select anything givem since none of them were right and got that question correct.
2) Option 4 should be like 0 to 2^16-1. But i am not sure whether even considering this, the option is correct or not.options 1,2,3 are correct.
3) Interesting question on threads. I would like to know answer from others. But upto my knowledge, b, d are correct and c is not correct.
4)5)6) Manfred has already explained it. But one info java.io.ioException is the superclass of all exceptions. So u can use it to catch all IO related exceptions. But not recommended of course.


------------------

***********************************************
Sun Certified Programmer for Java 2 Platform
***********************************************


Sun Certified Programmer for Java 2 Platform
Venkat Ramanan
Ranch Hand

Joined: Jan 25, 2001
Posts: 30
Hi,
You can find IBM Exam Questions at http://certify.torolab.ibm.com/
Regards
Venky
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Mock Questions