后编译错误,检查控制台? [英] Post Compile error, check Console?

查看:88
本文介绍了后编译错误,检查控制台?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

错误讯息与下面的实际代码一起发布。代码能够编译和运行,但不是打印到最后我收到一个弹出的错误消息(屏幕截图),但我不明白这是什么意思或为什么我得到它。任何人可以帮助?谢谢!

The error message is posted below along with with the actual code. The code is able to compile and run but instead of printing at the end I receive a pop up error message (screen shot below) but I don't understand what it means or why I am getting it. Can anyone help? Thanks!

public class Employee10
{   
    public static void main ( String args[] )
    {
        Employee e1 = new Employee();
        Employee[] arr = new Employee[2];

        int j = 0;

        for ( int i=0; i < 3; i++)
        {
            arr[0] = e1;

            String nameF = Input.getString("Please enter a First Name");
            String nameL = Input.getString("Please enter a Last Name");
            int Number = Input.getInt("Please enter an Employee Number");
            String Street = Input.getString("Please enter a Street address");
            String City = Input.getString("Please enter a City");
            String State = Input.getString("Please enter a State");
            double Zip = Input.getDouble("Please enter a Zip Code"); 
            int Month = Input.getInt("Please enter a Month");
            int Day = Input.getInt("Please enter a Day");
            int Year = Input.getInt("Please enter a Year");

            e1.setNumber(Number);
            e1.setName( new Name(nameF, nameL));
            e1.setAddress(new Address(Street, City, State, Zip));
            e1.setHireDate(new Date(Month, Day, Year));

            System.out.println(e1.getEmployeeString());


            arr[i] = e1;

        }   

        for ( j=0; j < arr.length; j++ )
        {
            System.out.println( arr[j].getEmployeeString() );
        }   
    }
}

错误消息:
(不幸的是,我无法嵌入照片,所以我只需要输入代码,因此这里是):

ERROR MESSAGE: ( Unfortunately I am not able to embed a photo so I just have to type out the code so here it is):


Java类文件Employee10.class无法启动。检查
控制台可能的错误消息。

The Java class file "Employee10.class" could not be launched. Check the Console for possible error messages.

这是什么意思?

推荐答案

如果您使用的是非常基本的 IDE BlueJ (因为你是一个初学者),我建议你放置像 System.out.println );
或类似的东西打印到控制台上的东西。使这个第一个语句 main .Now console 可以被视为您将看到您的输出语句显示的位置(原始定义)。可以被视为显示窗口。
当我学习java时,我使用了 BlueJ ,它从来没有触发过程序,直到有东西打印到控制台。它总是寻找一个打印

If you are using a very basic IDE like BlueJ(since you are a beginner),I would suggest you to place something like System.out.println("Beginning program"); or something similar which prints something onto the console.Make this the first statement in main.Now console could be considered as the place were you would see your output statements displayed(raw definition).Could be considered as a display window. I used BlueJ long back when I was learning java and it never triggered the program until there was something to print on to the console.It always lookes for a print statement to begin with.

最奇怪的部分是 - 它从不需要字符串数组 main function。我很惊讶,当我切换到eclipse和程序没有编译没有参数 main 。因此,一些非常基本的 IDEs 可能很奇怪。

And the strangest part was-It never required a string array as an argument in the main function.I was surprised when I switched to eclipse and the program didn't compile without the argument in main.So things could be strange with some very basic IDEs.

我建议你试试这个解决方案,尝试使用 IDE eclipse netbeans 。这些 IDEs 非常专业,它会给你立即和伟大的想法在程序中发生的错误。

I would suggest that you try out this solution and also try to use a good IDE like eclipse or netbeans.These IDEs are highly professional and would give you immediate and great ideas on errors that occur in a program.

这篇关于后编译错误,检查控制台?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆