“Class header expected instead” error

守給你的承諾、 提交于 2021-02-05 09:41:40

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!