Hi,
I do not see this problem. My config:
NetBeans 12.6
nb-javac not installed
Java 17.0.1
Windows 10
Maybe a problem of of the Java version or nb-javac ?
Regards
Helmut
Am 31.01.2022 um 04:54 schrieb Zulfi Khan:
Hi,
I am trying to create an array of Object of Account class:
public class RButtArrListJFrame extends javax.swing.JFrame {
ArrayList<Account> al_allAcc = new ArrayList<>();
//ArrayList<String> al_sav = new ArrayList<String>();
DefaultListModel <String> model = new DefaultListModel<String>();
Account[] acc = new Account[5];
acc[0] = new Account(200.0, 100, "SSUET1", 's');//Error
acc[1] = new Account(300.0, 101, "SSUET2", 's');//Error
acc[2] = new Account(400.0, 102, "SSUET3", 's');//Error
acc[3] = new Account(500.0, 103, "SSUET4", 'c');//Error
acc[4] = new Account(600.0, 104, "SSUET5", 'c');//Error
I am getting the message:
‘]’ expected, invalid method declaration return type required. I have
attached the image and account class file. Account class is given below:
public class Account {
private double balance;
private int number;
String name;
char accType;
Account(){
balance = 0.0;
number = 0;
final String name = "0";
accType ='\0';
}
Account(double dBal, int iNum, String strName, char chAccType){
balance = dBal;
number = iNum;
name = strName;
accType = chAccType;
}
Account (Account accObj){
balance = accObj.balance;
number = accObj.number;
name = accObj.name;
accType = accObj.accType;
}
double getBalance(){
return balance;
}
int getNumber(){
return number;
}
char getAccType(){
return accType;
}
void setBalance(double b){
balance =b;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail:[email protected]
For additional commands, e-mail:[email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
begin:vcard
fn:Helmut Leininger
n:Leininger;Helmut
email;internet:[email protected]
x-mozilla-html:TRUE
version:2.1
end:vcard
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists