I have the following code
import java.net.Socket;
import javax.swing.JOptionPane;
public class SettingTimeout {
public SettingTimeout() {
Socket.getSoTimeout();
}
public static void main(String[] args) {
}
}
The problem is that it will not compile, giving the error:
Cannot make a static reference to the non-static method getSoTimeout() from the type Socket
However, the constructor is obviously not static. What am I doing wrong?
Note: I know what static and non-static methods are. I just don't know why this non-static method is behaving as if it's static.