Best Practices is one of the key areas, and often you can impress your interviewers, peers, and code reviewers by applying the best practices to your code. If you are…
…Best Practices is one of the key areas, and often you can impress your interviewers, peers, and code reviewers by applying the best practices to your code. If you are…
Login Register 100+ Free Java interview FAQs 100+ Free Big Data interview FAQs
Q1 Why use mock objects in unit testing? A1 Unit testing is widely accepted as a “best practice” for software development. When you write an object, you must also provide…
Login Register 100+ Free Java interview FAQs 100+ Free Big Data interview FAQs
#1: Choose the right type of Java data structure based on usage patterns
like fixed size or required to grow, duplicates allowed or not, ordering is required to be maintained or not, traversal is forward only or bi-directional, inserts at the end only or any arbitrary position, more inserts or more reads, concurrently accessed or not, modification is allowed or not, homogeneous or heterogeneous collection, etc.…
Core Java best practices and JEE best practices can reveal a lot about your experience as a Java developer.
Q1. Can you list 10 JEE best practices from your experience?
A1.
DataSources make the code more portable than using the DriverManagers. For the DriverManagers you need to tightly couple the details like host, port, username, password, and driver class to connect to a database with the code, and even externalizing those in a properties file doesn’t give you the flexibility that the JNDI lookup give by configuring the DataSources on the application server.…
Q1. How will you go about improving on the following code snippet that calculates the new balance based on the current balance, total debits, and total credits? Note: All amounts…
Login Register 100+ Free Java interview FAQs 100+ Free Big Data interview FAQs
#1: ConcurrentModificationException Getting a ConcurrentModificationException when trying to modify (i.e. adding or removing an item) a collection while iterating. The following code throws a ConcurrentModificationException.
1 2 3 4 5 6 7 |
List<T> list = getListOfItems(); for (Iterator<T> iter = list. |