• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Mock Questions

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Venkat,
Could you please give me a link to the IBM mock exam? I'd like to try them.
Thanks,
LHS
 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
***********************************************
 
Venkat Ramanan
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
You can find IBM Exam Questions at http://certify.torolab.ibm.com/
Regards
Venky
reply
    Bookmark Topic Watch Topic
  • New Topic