Hey guys I am not seeing what I am doing wrong here. I am currently following this tutorial on how to implement the Singleton Pattern for a project and I set up some test files to see if it would work out well with what I'm doing, and as far as I can tell I am following the pattern perfectly and yet I can't seem to access ANY of the methods, this is the third time I've set this up in various ways, and as this is the simplest setup and it still doesn't work right, I am in the dark on whats going on here. I just need what I'm doing wrong here pointed out if at all possible. Here is the code:
DCTest.java (the Singleton Class)
package com.saphiric.simproject.datacontrols;
/**
* Created by Saphiric on 12/30/14.
*/
public class DCTest {
// Singleton Test
private static DCTest dct = new DCTest();
private DCTest(){
// Prevents outside instantiation
}
public static DCTest getInstance(){
return dct;
}
// test variables for making sure it can have dynamic fields
private int INT;
protected void setInt(int newInt){
INT = newInt;
}
protected int getINT(){
return INT;
}
}
DataCore.java (The file I want to access the Singleton Class)
package com.saphiric.simproject.datacontrols;
/**
* Created by Saphiric on 12/29/14.
*/
public class DataCore {
// Singletons Tests
DCTest test = DCTest.getInstance();
test.setInt(0);
public DataController data = new DataController();
public DecisionLocks locks = new DecisionLocks();
}