What is Effectively Final variable of Java 8

Java 8 introduced a new term : effectively final variables. A variable which is not declared as final but whose value is never changed after initialization is effectively final. 12345for (int i = 0; i < 10; i++) { new Thread(() -> { System.out.println("i = " + i); // Does not compile! }).start(); } The above code does not […]

Continue Reading

Hibernate JDBC Driver Connection URL strings

Below are the details of connection properties while connecting with different database. Oracle To connect with Oracle database JDBC connection properties look as follows: JDBC Driver oracle.jdbc.OracleDriver JDBC Url jdbc:oracle:thin:@localhost:1521/oradb Hibernate Dialect org.hibernate.dialect.Oracle12cDialect   MySQL To connect with MySQL database JDBC connection properties look as follows: JDBC Driver com.mysql.jdbc.Driver JDBC Url jdbc:mysql://localhost/upsilonwin_db Hibernate Dialect org.hibernate.dialect.MySQL57Dialect […]

Continue Reading

Algorithm: Quick Sort

Quick sort is comparison sort based on divide and conquer approach. It is in-place sorting algorithm so it require small additional amount of memory to perform sorting. Quick sort was developed by Tony Hoare in 1959. Complexity(Big O notation) Best-case  – O(n log n) Average-case – O(n log n) Worst-case – O(n²) Quicksort or partition-exchange sort, […]

Continue Reading

Important Questions on Java Serialization Asked in Interviews

What is Serialization in Java? How to make a Java class Serializable? What is the difference between Serializable and Externalizable interface in Java? How many methods Serializable interface has? If no method then what is the purpose of Serializable interface? What is serialVersionUID? While serializing you want some of the members not to serialize? How […]

Continue Reading

Why there are only Run-time exception in Spring ? 

Lets first understand the best practices regarding handling Exceptions while designing an API or framework. If the client can take some alternate action to recover from the exception, make it a checked exception. If the client cannot do anything useful, then make the exception unchecked. By useful, I mean taking steps to recover from the exception and […]

Continue Reading