这个问题在这里已经有答案了:
java:未解决的编译问题(8个答案)
5个月前关门了。
所以我试图在eclipse上构建一个email admini应用程序,但是我遇到了一个问题。控制台显示:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
email cannot be resolved to a type
at emailapp.EmailApp.main(EmailApp.java:6)
以下是我在两个类中编写的代码:
打包emailapp;
公共类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);
}
}
为什么我会把我的应用搞砸?
1条答案
按热度按时间l7wslrjt1#
问题出在
main
方法,Email em1 = new email("Goanar","Rambang");
哪里new email("Goanar","Rambang");
应该是new Email("Goanar","Rambang");