I am trying to declare static class variables which are filled with returns from file read methods:
public class myClass
{
public static int nBikeRides = OtherClass.getInt();
public static int nRuns = OtherClass.getInt();
public static void main(String args[]
{
....
}
}
However, it won't let me do this because I have to throw or catch the java.io.IOException. I cannot use a try and catch here, nor can I have the class throw the exception. Is there a way around this or do I have to set them to 0 and initialize from a method?
-Greg :-Q
public class myClass
{
public static int nBikeRides = OtherClass.getInt();
public static int nRuns = OtherClass.getInt();
public static void main(String args[]
{
....
}
}
However, it won't let me do this because I have to throw or catch the java.io.IOException. I cannot use a try and catch here, nor can I have the class throw the exception. Is there a way around this or do I have to set them to 0 and initialize from a method?
-Greg :-Q
![flaga.gif](http://www.gifs.net/animate/flaga.gif)