I'm new to java. I'm facing a class declaration because my main is a static class. If i remove the static it will return there's no main class. So all my variable passing in can't be executed, i've tried google it and i've been getting no luck. That's why I'm posting here . Thanks
package javaapplication2;
import java.security.MessageDigest;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class JavaApplication2 {
private void outluck() {
}
public interface DbType {
public void mySQL();
public void microsoftSQLServer();
}
public static void main(String[] args) {
outluck(); <--- Error
}
public String Encrypt(String s) {
}
public String hehe(String ooo){
String x="";
try {
//
}
} catch (SQLException ex) {
}
return x;
}
public class Database implements DbType {
public void 1()
public void 2()
public void 3()
public void 4()
}
}
The error was :
non-static method outluck() cannot be referenced from a static content.
I tried making it non-static but i still have error. The database class is my class for the database connection.
The hehe class is for do a query towards a db then fetch the data and pass it to encrypt function to update the database.