问题
Why do I get this error?
I've been trying to solve it.
package Controller;
import View.ViewGegevens; //Error
import Model.Persoon;
{
private String Voornaam;
private String Tussenvoegsels;
private String Achternaam;
private String Woonplaats;
private int Telefoonnummer;
private String Aardappel;}
public class InvullenData implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
回答1:
These lines should be within any of class or interface
{
private String Voornaam;
private String Tussenvoegsels;
private String Achternaam;
private String Woonplaats;
private int Telefoonnummer;
private String Aardappel;
}
回答2:
whatever the variables your declaring must be enclosed within a class because class is a type of Wrapper Mechanism unless they are declared inside the class those will not be available to your class
来源:https://stackoverflow.com/questions/19929173/class-header-expected-instead-error