• 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

doubts from ibm test

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
FEW QUESTIONS FROM IBM TEST.
----------------------------
Can any one verify my answers if they are correct:-
12)
An object should be thought of as:
a) A data holder only
b) An entity which combines data and functions on that data to create behavior

c) A place, like a file, to store related methods and no data

d) A template for creating similarly behaving things

My answer : B
15)
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

My answer: A/B/E
16)
When comparing Strings and StringBuffers, which of the following statements evaluate correctly and return true:
a) new String("IBMVAJava") == new String("IBMVAJava")

b) new String("IBMVAJava").toString().equals(new String("IBMVAJava"))

c) new StringBuffer("IBMVAJava") == (new StringBuffer("IBMVAJava"))

d) new StringBuffer("IBMVAJava").equals(new StringBuffer("IBMVAJava"))

My answer: D
20)
AWT components get their look and feel from:
a) Programmable painting support classes

b) SWING classes

c) JVM drawing primitives

d) Peer classes

My answer : D

26)
Based upon the code below, what is drawn:
1. g.setColor(Color.blue.red.yellow);
2. g.fillRect(50, 50, 100, 100);
3. g.setColor(Color.black);
4. g.drawString("Hello World", Font.ITALIC, 24);
a) This code will not compile due to the setColor() method in line 1.

b) This code compiles and runs successfully.

c) A blue square will be drawn.

d) A yellow square will be drawn.

e) The string will not appear since it is drawn after fillRect() is called.

My answer : None is correct
17)
Primitive type wrapper classes:

a) Allow primitive types to behave as reference types

b) Allow operator overloading to be implemented for primitive numeric types

c) Provide string parsing and conversion methods

d) Provide arithmetic operators such as plus and minus

e) Are provided for all primitive types, including void

My answer: A/E
Thanks a lot!
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My answers are as follows:
12)B, I agree with you
15) a) - False. JVM kills daemon threads when there are no user threads alive.
b)TRUE
c) FALSE
d)FALSE
e)TRUE
16) ONLY B i sTRUE
20) D
26)D is TRUE
as far as e is concerned, since a small squiggle of the the string will appear on the top. I did not choose e coz it has nothing do with whether the string was drawn after fillRecr ir not. That is why I think it is wrong.
17) A& E
as far as C is concerned, Character does not provide String parsing. So, C cannot be generalised for all wrapper classes. So, I am choosing only A & E as correct answers.
Please let me know if there is something wrong with the above ans
-sampaths77
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I didnt understand option E of Qn 17
Primitive type wrapper classes


Are provided for all primitive types, including void


void, primitive type? what is being said here?
could somebody explain ,please?
thanks in advance..
Ramani.

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic