Eclipse – 编译问题

huangapple go评论60阅读模式
英文:

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");

huangapple
  • 本文由 发表于 2020年8月23日 07:29:46
  • 转载请务必保留本文链接:https://go.coder-hub.com/63542039.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定