英文:
Eclipse - Comp Issues
问题
以下是已翻译的部分:
所以我正在尝试在Eclipse上构建一个电子邮件管理应用程序,但我遇到了一个问题。控制台显示:
异常线程“main”java.lang.Error:未解析的编译问题:无法将电子邮件解析为类型
在emailapp.EmailApp.main(EmailApp.java:6)
以下是我在两个类中已经编写的代码:
package emailapp;
public class EmailApp {
public static void main(String[] args) {
Email em1 = new Email("Goanar", "Rambang");
}
}
package emailapp;
public class Email {
private String firstName;
private String lastName;
private String password;
private String department;
private int mailboxCapacity;
private String alternateEmail;
//蓝图-模板
//为名字添加构造函数
//询问部门
//生成随机密码
//设置邮箱容量
//设置备用电子邮件
//更改密码
//构造函数
public Email(String firstName, String lastName) {
this.firstName = firstName;
this.lastName = lastName;
System.out.println("已创建电子邮件:" + this.firstName + " " + this.lastName);
}
}
有没有可能是我弄乱了我的应用程序的原因?
英文:
So I am trying to build a Email Admini App on Eclipse but there is a issue that I am
having. The console says:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
email cannot be resolved to a type
at emailapp.EmailApp.main(EmailApp.java:6)
Here is my code that I have written already in my 2 classes:
package emailapp;
public class 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);
}
}
Any reasons why I may be screwing up my app?
答案1
得分: 0
问题出在 main
方法中,Email em1 = new email("Goanar","Rambang");
,其中 new email("Goanar","Rambang");
应该改为 new Email("Goanar","Rambang");
。
英文:
The problem is in the main
method, Email em1 = new email("Goanar","Rambang");
where new email("Goanar","Rambang");
should be new Email("Goanar","Rambang");
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论