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:
class DataBase {
String[2] db;
void formatDataBase() {
for (i=0; i<=2; i++) {
db=null;
}
}
// void addBrand(String brand) {
// for (int i=1; i<=2; i++) {
// if (db==null) {db=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!:withstup:
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:
class DataBase {
String[2] db;
void formatDataBase() {
for (i=0; i<=2; i++) {
db=null;
}
}
// void addBrand(String brand) {
// for (int i=1; i<=2; i++) {
// if (db==null) {db=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!:withstup: