Java Interview Questions
- 0of 0 votes
AnswersAn unsorted array contains elemets 1-1000, we are replacing one element in the array with n , and n is greater than 1000. How can we find out what element got replaced with n
- sanoj January 16, 2012 in India| Report Duplicate | Flag | PURGE
Software Engineer / Developer Algorithm Arrays Coding Java - 0of 0 votes
AnswersDuring my 2nd interview
- UKSJayarathna December 22, 2011 in United States
1. Use 2 stacks to create a queue structure
2. If you have a tree how to verify it a BST
A. User the inorder traversal
3. Write a code to implement above question 2.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Java - 0of 0 votes
Answerswhy is string immutable?
- sweet.prash December 20, 2011 in India for BIRD| Report Duplicate | Flag | PURGE
SAS Research Software Engineer / Developer Java - 0of 0 votes
AnswerLife cycle of servlet
- sweet.prash December 20, 2011 in India for BIRD| Report Duplicate | Flag | PURGE
SAS Research Software Engineer / Developer Java - 0of 0 votes
AnswersWAP in Java to create deadlock
- saurabhsonu001 December 03, 2011 in India| Report Duplicate | Flag | PURGE
Infibeam Software Engineer / Developer Java - 0of 0 votes
AnswersWhy was multiple inheritance not included in Java though it was previously in C++?
- engr.fas November 29, 2011 in Pakistan for Android Application Development| Report Duplicate | Flag | PURGE
Sileria Inc. Software Engineer / Developer Java - 0of 0 votes
AnswersWrite a function for pow(double a,int b)? Prepare floating point intricacies in java...
- NuclearTeen November 23, 2011 in United States for Security| Report Duplicate | Flag | PURGE
Linkedin Software Engineer / Developer Java Algorithm - 0of 0 votes
AnswersWhat is the fastest way print output to STDOUT in Java?
- Karthik Sharma November 18, 2011 in India| Report Duplicate | Flag | PURGE
TATA Consultancy Services Software Engineer / Developer Java - 0of 0 votes
Answers4 subjective questions.
- vaibhav88315 November 09, 2011 in India for Java
Implement blocking queue
Explain Producer Consumer
how to design tweeter like application.| Report Duplicate | Flag | PURGE
Samsung Software Engineer / Developer Java - 0of 0 votes
Answers20 objective based on pattern of SCJP exam. easy
- vaibhav88315 November 09, 2011 in India for Java| Report Duplicate | Flag | PURGE
Samsung Software Engineer / Developer Java - 0of 0 votes
Answerswhy java is called object oriented language?
- jogendra.png November 03, 2011 in -| Report Duplicate | Flag | PURGE
Java - 1of 1 vote
Answers- Scrollable is an interface
- Nish October 25, 2011 in United States
- Writable is an interface
- TextScreen is an abstract class
- Videoscreen is a class that extends TextScreen and implements both Scrollable and Writable
in the scenario above which of the following statements is always true
a. A VideoScreen object cannot be passed to a method that expects a Writable
b. A Scrollable object can be cast to produce a VideoScreen
c. A VideoScreen object cannot be passed to a method that expects a TextScreen
d. VideoScreen can be cast as a Scrollable
e. A VideoScreen cannot be passed to a method that expects a Scrollable| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer Java - 0of 0 votes
AnswersWrite a program to reverse a character array "Hello World". Give different test cases(input arrays) to test your code.
- merry September 21, 2011 in United States for Quality Engineering| Report Duplicate | Flag | PURGE
Salesforce Quality Assurance Engineer Java Testing - 0of 0 votes
AnswersWrite a program to find the smallest number from an array with elements{1,10, -5, 10} Write the test cases for it(Give different input arrays to test ur code)
- merry September 21, 2011 in United States for Quality Engineering| Report Duplicate | Flag | PURGE
Salesforce Quality Assurance Engineer Java Testing - 0of 0 votes
AnswersYou have got two jobs J1 and J2. You have two threads T1 and T2 for the respective jobs. Write a program such that you can assure that J2 will start only when J1 ends
- anshulzunke September 17, 2011 in India| Report Duplicate | Flag | PURGE
Tribal Fusion Software Engineer / Developer Java - 0of 0 votes
AnswersHow many types of class loaders do you know in java
- anshulzunke September 17, 2011 in India| Report Duplicate | Flag | PURGE
Tribal Fusion Software Engineer / Developer Java - 0of 0 votes
AnswerYou have two hashmaps HM1 and HM2 where key = Id(long) value = timestamp. You need to give a program to return a list of Ids combined from both the hashmaps such that they are sorted as per their timestamps
- anshulzunke September 17, 2011 in India| Report Duplicate | Flag | PURGE
Tribal Fusion Software Engineer / Developer Java - 0of 0 votes
AnswersHow will you make your own Hashmap class?
- anshulzunke September 17, 2011 in India| Report Duplicate | Flag | PURGE
Tribal Fusion Software Engineer / Developer Java - 0of 0 votes
Answerswhat does the yeild method do in case of a thread lifecycle ? Explain with a neat example demonstrating the use of yield method?
- Deepak August 30, 2011| Report Duplicate | Flag | PURGE
Infosys Software Engineer / Developer Java - 0of 0 votes
AnswersGiven a filename say filter_file.c , program to search for any pattern in order
- Sujal August 19, 2011
ex flt_fl -. true
flt_el - false
search text is in order and characters occur multiple. any permutation. unwanted characters not allowed.| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Java - 0of 0 votes
Answersround 2:
- dhwanirtrivedi August 03, 2011
1. explain me final, finally and finalized in java. (on JAVA)
2. 2. you have unsorted array[n] elements. the numbers in the array[n] occurs event times except one number occurs odd time. So, write an algorithm to find that number. Also explain its complexity too. (time and space) both. (On ALGORITHM)
3. you have html page directory. in each html page u have written name and phone number. now you have to make normal directory from that information. write an algorithm that convert html directory to normal directory.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Java - 0of 0 votes
AnswersWhat does IDL stands for ?
- dhaval0129 July 26, 2011| Report Duplicate | Flag | PURGE
Bloomberg LP Java - 0of 0 votes
AnswerWhat is IDL?
- dhaval0129 July 26, 2011
a.) International Document Language - a language-independent text format for transmitting documents
b.) Independent Device Layer - a software abstraction that sits on top of different hardware presenting a uniform interface
c.) Interface Definition Language - a programming-language-independent method for defining object interfaces
d.) Internet Dialup Layer - a communications layer that manages TCP/IP connections over a modem link
e.) Image Definition Language - a graphics definition language for defining portable images| Report Duplicate | Flag | PURGE
Bloomberg LP Java - 0of 0 votes
AnswersConnection cn;
- dhaval0129 July 26, 2011
String queryStr;
// .. Code to open the connection and create a query not shown
cn.setAutoCommit(false);
cn.executeQuery(queryStr);
// *** Line A
In the code above, which one of the following substitutions for Line A writes the query results to the database?
a.) cn.update();
b.) cn.flush()
c.) cn.executeQuery("TRANSACTION END");
d.) cn.commit();
e.) cn.rollback();| Report Duplicate | Flag | PURGE
Bloomberg LP Java - 0of 0 votes
AnswerFilePermission fp=new FilePermission("/tmp/110115.tmp","write");
- dhaval0129 July 26, 2011
AccessController.checkPermission(fp);
What happens if the code above is run from a thread that has NOT been granted access to the /tmp directory?
a.) The runtime system presents a browser dialog to the user.
b.) The virtual machine exits.
c.) The call to AccessController throws an AccessControlException.
d.) The runtime system terminates the thread that called AccessController.
e.) The call to AccessController returns false.| Report Duplicate | Flag | PURGE
Bloomberg LP Java - 0of 0 votes
AnswersWhat is the main purpose of Java servlets?
- dhaval0129 July 26, 2011
a.) They allow browsers to upload intelligent search agents to a Web server.
b.) They allow resource-limited devices such as printers or embedded systems to respond to http requests.
c.) They allow Java programs to access back-end databases such as Oracle and Sybase.
d.) They allow for generation of dynamic content and processing of user input on the Web.
e.) They handle the communications protocols required to send applets to Web browsers.| Report Duplicate | Flag | PURGE
Bloomberg LP Java - 0of 0 votes
AnswerWhich statement below describes a class that implements the Enumeration interface?
- dhaval0129 July 26, 2011
a.) It has implementations of the toString() and getNextString() methods.
b.) It is a subclass of Vector.
c.) It contains implementations of the hasMoreElements() and nextElement() methods.
d.) It can be used to store associative arrays.
e.) It can work with the StringTokenizer class.| Report Duplicate | Flag | PURGE
Bloomberg LP Java - 0of 0 votes
AnswersHow do you get a reference to the system clipboard?
- dhaval0129 July 26, 2011
a.) java.awt.Toolkit.getDefaultToolkit().getSystemClipboard()
b.) Java can't get access to the clipboard.
c.) new java.awt.datatransfer.Clipboard()
d.) System.lang.ClipBoard
e.) java.awt.datatransfer.Clipboard.getDesktopClipboard()| Report Duplicate | Flag | PURGE
Bloomberg LP Java - 0of 0 votes
AnswersWhat is an RMI "stub"?
- dhaval0129 July 26, 2011
a.) It is used by the client to find remote objects on a server.
b.) It acts as a client-side proxy to receive RMI calls and pass them to the server.
c.) It enables applets to make RMI calls without violating browser security.
d.) It receives RMI calls from the server to enable applet callbacks.
e.) It is the interface implemented by both the client and server objects.| Report Duplicate | Flag | PURGE
Bloomberg LP Java - 0of 0 votes
AnswersWhich one of the following correctly describes the function of a bean's home interface in EJBs?
- dhaval0129 July 26, 2011
a.) It maps Java types to underlying database types.
b.) It defines how to create, find, or remove the bean.
c.) It defines all of the beans public methods.
d.) It is the container for the bean and it manages transactions.
e.) It interfaces to a naming service to allow remote objects to lookup the bean.| Report Duplicate | Flag | PURGE
Bloomberg LP Java