What is Double Brace Initialization in Java? Anti Pattern Example

Double brace initialization is a Java idiom to initialize a Collection like a list, set and map at the time of declaration. At times, you need a list of fixed elements e.g. supported products, supported currencies or some other config, and on the spot initialization reduce line of code and improves readability. Double brace initialization idiom become popular because there is no standard way to create and initialize Collection at the same time in Java. Unfortunately, unlike other language Java doesn't support collection literals yet. Due to this limitation, creating an unmodifiable List with small numbers of elements requires many lines of code involving creating list, repeatedly calling add() method to add those elements and then finally wrapping it into unmodifiable list as shown below :

SQL Server JDBC Error: The TCP/IP connection to the host Failed

I had installed SQL SERVER 2014 Express edition and I was trying to connect to SQL SERVER from Java program using JDBC, but I was repeatedly getting following error:

com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host localhost, port 1433 has failed. Error: "connect timed out. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".Error while closing connection !!null

20 Questions You can ask to Interviewer in Programming Job Interviews?

From the first round to HR round, from telephonic to face-to-face, in almost all kind of programming interviews, there will be a time when Interviewer will give you chance to ask questions. Many programmers are too concern about asking questions, and they politely decline ; Well it's your chance to learn about the Job you are going to do, and you shouldn't let this opportunity goes away. Interviewer, also judge you by your questions; a good, thoughtful, positive question can create the great impression on Interviewer's mind. It also shows that  the interest of a candidate for a Job.

Share Your Interview Experience with Javarevisited

Hello Guys,
How are you? Hope you are doing well.
It's been 5 years since I have started Javarevisited. In last five years, I have worked hard to make Javarevisited a good resource to prepare for Java interviews, and to make it even more useful, I am inviting you, my readers, to share your Interview experience with us, the Javarevisited community. If you like Javarevisited and think that it has helped you in past, and you want to give something back to the community, then it's time to share your own interview experience with us.