When I use sonarQube to analyze my code, a rule in sonarQube show “Remove the ‘volatile’ keyword from this field.”
But I want to create a singleton object. My code is like the following:
public class Singleton {
private static volatile Singleton singleton = null;