I have a text file and I am reading the contents of the file in this way.
VARIABLE1 = new String(Files.readAllBytes(Paths.get(VARIABLE1PATH)), StandardCharsets.UTF_8);
However, this throws the following error.
Write to static field .....test.VARIABLE1 from instance method
Is there a way to fix this?
I was not expecting an error