Search Interview Questions | More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know. |
|
| ||||
Interview Questions and Answers - Order By Newest | ||||
| ||||
Ans. <a href="http://javahungry.blogspot.com/2015/03/difference-between-array-and-arraylist-in-java-example.html" rel="nofollow">http://javahungry.blogspot.com/2015/03/difference-between-array-and-arraylist-in-java-example.html</a> | ||||
Sample Code for ArrayList | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  array  arraylist Asked in 11 Companies basic   frequent | ||||
| ||||
Ans. An Error indicates serious problems that a reasonable application should not try to catch whereas An Exception indicates conditions that a reasonable application might want to catch. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  error  exception handling  exceptions Asked in 2 Companies basic   frequent | ||||
Frequently asked in Accenture. | ||||
| ||||
Ans. [Open Ended Answer] | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  general question  non technical question Asked in 20 Companies   frequent | ||||
| ||||
Ans. An Exception in java is the occurrence during computation that is anomalous and is not expected. Exception handling is the mechanism which is used to handle such situations. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  exception handling Asked in 18 Companies basic   frequent | ||||
Frequently asked Spring interview question. | ||||
| ||||
Ans. Core: [Core, Bean, Context, Expression Language] Web: [Web, Portlet, Servlet, etc] Data Access [JMS, JDBC, etc] AOP, Aspect | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  spring  spring framework components Asked in 12 Companies | ||||
| ||||
Ans. Constructors are used to initialize the state of an object. If there are no constructor , objects won't have any initialized state and hence it's elements may contain garbage values. If the memory were used as is, the behavior of the object would also be unpredictable. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  constructor Asked in 5 Companies | ||||
| ||||
Ans. DELETE FROM TABLE WHERE ROW_NUM NOT IN ( SELECT MAX(ROW_ID) FROM TABLE GROUP BY DUPLICATE_FIELD ) or DELETE FROM TABLE a WHERE ROW_ID >(SELECT MIN(ROW_ID FROM TABLE b WHERE a.DUPLICATE_FIELD=b.DUPLICATE_FIELD); | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   Asked in 3 Companies | ||||
| ||||
Ans. synchronized is a keyword and a modifier. The synchronized keyword is used to indicate that a method can be accessed exclusively by one thread at a time. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  synchronization  synchronized  modifier  identifier Asked in 2 Companies | ||||
| ||||
Ans. 1. Arrays don't provide any built in support for sorting searching like operation and we need to do it explicitly. 2. It can hold only homogeneous objects, 3. We have to reserve memory as no dynamic expansion allowed. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  arrays  arraylist  arrays vs arraylist Asked in 3 Companies | ||||
Very frequently asked. Usually among very first few questions. | ||||
| ||||
Ans. Encapsulation is a feature of OOP's that binds the data and it's associated methods together as a single unit and facilitate protection and data hiding by providing minimal interface to outside. For example - member variables are declared private and are accessed through public methods. Moreover we have private methods that can only be used internally and hence providing minimal interface to outside class through use of public methods. | ||||
Sample Code for encapsulation | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  encapsulation  object oriented programming (oops)  oops concepts  oops  oops concepts  oops features Asked in 4 Companies Basic   frequent | ||||
| ||||
Ans. You can implement encapsulation in Java by keeping the fields (class variables) private and providing public getter and setter methods to each of them. Java Beans are examples of fully encapsulated classes. Encapsulation in Java: Restricts direct access to data members (fields) of a class. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  oops  oops example  oops concepts  oops features Asked in 2 Companies basic   frequent | ||||
| ||||
Ans. Generics are a facility of generic programming that were added to the Java programming language in 2004 within J2SE5.0. They allow "a type or method to operate on objects of various types while providing compile-time type safety. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  generics Asked in 7 Companies | ||||
| ||||
Ans. We can have 2 entities i.e EMPLOYEE and ADDRESS and can have a relationship Table , EMPLOYEE_ADDRESS having one to may relationship between the two. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  database schema   design Asked in 2 Companies | ||||
| ||||
Ans. The Java collections framework (JCF) is a set of classes and interfaces that implement commonly reusable collection data structures. Although referred to as a framework, it works in a manner of a library. The JCF provides both interfaces that define various collections and classes that implement them. | ||||
Sample Code for Map Sample Code for HashMap Sample Code for Treemap Sample Code for set Sample Code for hashset Sample Code for treeset Sample Code for list Sample Code for arraylist Sample Code for linkedlist Sample Code for queue Sample Code for priorityqueue Sample Code for concurrenthashmap Sample Code for vector Sample Code for stack | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  collections Asked in 9 Companies basic   frequent | ||||
| ||||
Ans. The most effective and acceptable reasons for leaving your current job should be positive e.g. moving forward in your life or career | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   Asked in 21 Companies | ||||
| ||||
Ans. https://www.geeksforgeeks.org/arrays-sort-in-java-with-examples/ | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  array  sorting Asked in 16 Companies basic   frequent | ||||
| ||||
Ans. == compares values === is used in scripting languages for comparing two values as well as there data tpe. like in js,php. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  ==  ===  == vs === Asked in 13 Companies basic   frequent | ||||
| ||||
Ans. https://blog.timesunion.com/careers/the-10-most-important-personality-traits-for-career-success/633/ | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   Asked in 32 Companies | ||||
| ||||
Ans. Core technologies: dependency injection, events, resources, i18n, validation, data binding, type conversion, SpEL, AOP. Testing: mock objects, TestContext framework, Spring MVC Test, WebTestClient. Data Access: transactions, DAO support, JDBC, ORM, Marshalling XML. Spring MVC and Spring WebFlux web frameworks. Integration: remoting, JMS, JCA, JMX, email, tasks, scheduling, cache. Languages: Kotlin, Groovy, dynamic languages. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   Asked in 2 Companies | ||||
| ||||
Ans. table per hierarchy table per concrete class table per sub class | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  hibernate mapping  hibernate associations Asked in 4 Companies | ||||
| ||||
Ans. If there is a situation to remove duplicates values from an arrayList. Developer implemented using legacy for-loop where I suggested to use Linked hash set to remove duplicates from the list. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  Clean code Asked in 3 Companies | ||||
| ||||
Ans. Single Level Multi Level Hierarchical Multiple Hybrid | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   Asked in 1 Companies | ||||
| ||||
Ans. Maven requires installation in the working system and the Maven plug-in for the IDE. If the Maven code for an existing dependency is unavailable, you cannot add that dependency using Maven itself. Some sources claim that Maven is slow. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   Asked in 1 Companies | ||||
| ||||
Ans. By using assertNotNull(employee_address) | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   Asked in 1 Companies | ||||
| ||||
Ans. use collections.frequency() method to find out the frequency, if it is greater than 1 then it is a duplicate element. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   Asked in 1 Companies | ||||
| ||||
Ans. It gives us the liberty to throw the specific exceptions which are required and also we can control the handling of exceptions | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   Asked in 1 Companies | ||||
| ||||
Ans. The Java String class intern() method returns the interned string. It returns the canonical representation of string. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   Asked in 1 Companies | ||||
| ||||
Ans. Choose the server from the list of defined servers under J2EE Server. Choose the project to debug. Click Apply to save changes. Click Debug to start the server and run the application. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  debugging  debugging multi server application Asked in 1 Companies | ||||
| ||||
Ans. Struts controller uses the Command design pattern and the action classes use the Adapter design pattern. The process() method of the RequestProcessor uses the Template method design pattern. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  Struts Design patterns Asked in 1 Companies | ||||