What is the purpose of a static method in interface from Java 8?

Why are static methods supported from Java 8? What is the difference between the two lines in main method in below code? package sample; public class A { public static void doSomething() { …

How to ensure thread safety of utility static method?

Is there any general way or rules exits by which we can ensure the thread safety of static methods specifically used in various Utility classes of any applications. Here I want to specifically point …