In C# I am able to create a class like this:
static class clsDBUtils
{
public static SQLiteCommand cmd;
public static SQLiteConnection conn;
public static String databaseFilePath;
public static bool getConnection()
{
}
}
Then anywhere in my namespace can use without initialization this way:
clsDBUtils.getConnection();
How can this be rewritten for Java?
I don’t want to use:
clsDBUtils sqlutil= new clsDBUtils();
Basically the same way, just make a (normal)
finalclass with a private contructor (prevents being able to donew) and add static members only.