• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Doubt in ejb

 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear All;

Yesterday i went for an interview for the post of Java Programmer.In second round of

technical interview there were some questions in which i having some doubts so i am

mentioning that noted questions with options..

kindly let me know correct answers so my doubt gets cleared

1>What is the effect of adding the sixth element to a vector created in the folowing manner?
new Vector(5, 10);
IN THIS I THINK A SHOULD BE THE ANSWER...
A. nothing, the vector will have grown when the fifth element was added
b. the vector grows size to a capacity of 10 elements
c. An indexOutOfBounds exception is raised
d. The vector grows in size to a capacity of 15 elements

2>A System has a transaction manager, which manages transaction among multipe resources usin

the 2-PC protocol. During one such transaction using User Transaction, while trying to

commit data to one resource I got a Heruistic message.

A. The transaction managerhas decided not to commit data to the resource and hence sends

information back to the client saying that it(Transaction Manager) has taken a Heuristic

decision
B. The resource decides to commit data on its own without permission from the Trancsaction

Manager and informs the transaction manager that it(Transaction Manager)has taken a

Heuristic decision, which in turn inform the client.
C. The resource decides not to commit data by taking permission from the Transaction Manager

and informs the Transaction Manager that it(Transaction Manager)has taken a Heuristic

decision, which in turn inform the client.
D. The resource decides not to commit data without taking permission from the Transaction

Manager(Transaction Manager) and informs the transaction manager that it has taken a

Heuristic dexesion, which in turn inform the client.


Hope to hear from you soon.

Thanks & Best Regards,
Brijesh shah
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please check with the javaranch's naming policy.

http://www.javaranch.com/name.jsp
[ June 23, 2007: Message edited by: Rahul Bhattacharjee ]
 
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For the first question

public Vector(int initialCapacity,
int capacityIncrement)Constructs an empty vector with the specified initial capacity and capacity increment.

Parameters:
initialCapacity - the initial capacity of the vector.
capacityIncrement - the amount by which the capacity is increased when the vector overflows.

http://java.sun.com/j2se/1.4.2/docs/api/java/util/Vector.html

For the second question

Answer seems to be (B). But I am not sure

http://java.sun.com/j2ee/1.4/docs/api/javax/transaction/HeuristicMixedException.html
 
reply
    Bookmark Topic Watch Topic
  • New Topic