• Post Reply Bookmark Topic Watch Topic
  • New Topic

please slove my java questions as i am preparing for interview.. very urgent..help me  RSS feed

 
bablu srivastav
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Test Questions

1) The following code is used to connect to an external service and send it a message. If either of the connect() or send() methods fail, an exception of type Exception is thrown. Modify the code so that the functionality is the same but the Connection is always closed.

Connection c = new Connection();
c.connect(�service�);
c.send(�message�);
c.close();











2) What is the standard tool use for generating documentation pages from doc comments.



3)What is the name of the class library most commonly used when generating unit tests.



4)A way to enable a class (that implements public void run()) to run a thread is to have it extend the Thread class. How else can we enable a class to run a thread.



5) How can you destroy an object in Java?




6) What would be the obvious Java collection type to use to store objects for fast retrieval by a key and which gives the ability to traverse the objects in key order.



7) What class of object would you use to hold a string of characters that needed to be frequently modified by insertions, deletions and appends.
 
Joe Ess
Bartender
Posts: 9436
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ease up. There is nothing "urgent" for us about you waiting until the last minute to prepare for your interview.
All of these questions are extremely basic Java questions. You could answer all of them by spending a few minutes searching or browsing the Java Tutorial.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!