public class JAVA2_12 {
public static void main(String[] args)
{
Person person[] = new Person[4];
person[0] = ("Hong Gil-dong", 2000, 4000);
}
class Person
{
public String name;
public int date;
public int salary;
Person(String name, int date, int salary)
{
this.name = name;
this.date = date;
this.salary = salary;
}
}
}
The coding was done to use the structure array, but when running, Syntax error on token "=", Name expected after this token appears I wonder what the reason is
java
public class Person{
public String name;
public int date;
public int salary;
Person(String name, int date, int salary){
this.name = name;
this.date = date;
this.salary = salary;
}
public static void main(String[] args){
Person person[] = new Person[4];
person[0] = new Person ("Hong Gil-dong", 2000, 4000);
}
}
541 Uncaught (inpromise) Error on Electron: An object could not be cloned
548 Understanding How to Configure Google API Key
550 PHP ssh2_scp_send fails to send files as intended
543 Unable to install versioned in Google Colab
550 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
© 2024 OneMinuteCode. All rights reserved.