hey you all
i'm trying to initialize a databse, which is no more then a simple string array. i want to withdraw data from this array using another file.
here's my code:
PHP Code:
class DataBase {
String[2] db;
void formatDataBase() {
for (i=0; i<=2; i++) {
db[i]=null;
}
}
// void addBrand(String brand) {
// for (int i=1; i<=2; i++) {
// if (db[i]==null) {db[i]=brand;}
// }
// }
}
but i get the following errors:
3 errors
yotam@main computer:~/Documents/java/Car$ javac DataBase.java
DataBase.java:3: ']' expected
String[2] db;
^
DataBase.java:3: ';' expected
String[2] db;
^
DataBase.java:3: <identifier> expected
String[2] db;
^
3 errors
yotam@main computer:~/Documents/java/Car$
anyone? i'm lost, have no idea!