I've tried to find a solution to my the compile error it works when ran in eclipse but not if i try to compile it in the terminal..
Here are the two classes I've started to write
load.java
package doom;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.Arrays;
public class load {
public int row;
public int columns;
private char[][] world;
public load() throws IOException{
BufferedReader file01 = new BufferedReader(new FileReader("map1.txt"));
int rows = 0;
while((file01.readLine()) != null){
rows++;
}
world = new char[rows][];
}
public void getMap() throws IOException{
BufferedReader file01 = new BufferedReader(new FileReader("map1.txt"));
String line;
int i = 0;
while((line=file01.readLine()) != null){
world[i++] = line.toCharArray();
}
System.out.println(Arrays.deepToString(world));
System.out.println(world[4][6]);
file01.close();
}
}
start.java
package doom;
import java.io.IOException;
public class start {
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
load world = new load();
world.getMap();
}
}
Here's the error I am getting when trying to compile in terminal.
138-38-157-112:tet ciaranashton$ javac start.java
start.java:9: error: cannot find symbol
load world = new load();
^
symbol: class load
location: class start
start.java:9: error: cannot find symbol
load world = new load();
^
symbol: class load
location: class start
2 errors