【问题标题】:Eclipse - Comp Issues [duplicate]Eclipse - 比较问题 [重复]
【发布时间】:2020-08-22 23:29:46
【问题描述】:

所以我正在尝试在 Eclipse 上构建一个电子邮件管理应用程序,但是我遇到了一个问题 有。控制台说:

Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
email cannot be resolved to a type

at emailapp.EmailApp.main(EmailApp.java:6)

这是我已经在我的 2 个课程中编写的代码:

打包电子邮件应用程序;

公共类 EmailApp {

public static void main(String[] args) {
    Email em1 = new email("Goanar","Rambang");
}

}


public class Email {
    private String firstName;
    private String lastName;
    private String password;
    private String department; 
    private int mailboxCapacity;
    private String alternateEmail; 
    
    //The Blueprint - Template
    // Add constructor for first and last name
    // Ask for department]
    // Generate random password
    // Set mailbox capacity
    // Set the alternate email
    // Change the password 

    //Constructor*/
    public Email(String firstName, String lastName) {
        this.firstName = firstName;
        this.lastName = lastName;
        System.out.println("EMAIL CREATED " + this.firstName + "" + this.lastName);
    }
}

我可能会搞砸我的应用程序的任何原因?

【问题讨论】:

    标签: java string eclipse int this


    【解决方案1】:

    问题出在main 方法中,Email em1 = new email("Goanar","Rambang"); 其中new email("Goanar","Rambang"); 应该是new Email("Goanar","Rambang");

    【讨论】:

    • 非常感谢!我是编码的初学者,所以知道你的代码可能会被一个大写字母搞砸,这对我来说太疯狂了!再次感谢! :)
    • 是的,几乎所有内容都区分大小写。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-04
    • 2021-03-24
    • 1970-01-01
    • 2021-02-04
    • 2020-10-09
    相关资源
    最近更新 更多