错误信息:诠释水湿转换为类型 [英] Error Message: Int cann't be converted to type

查看:128
本文介绍了错误信息:诠释水湿转换为类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我非常非常新我介绍到Java课程,我一直在寻找帮助的,我收到了一个错误。错误信息与实际code一起贴在下面。有谁知道为什么我收到此消息,并无论如何要帮我?在code是能够能够编译和运行而不是在最后打印我收到一个弹出错误信息(下面的屏幕截图),但我不明白这意味着什么,或者为什么我得到它。任何人都可以帮忙吗?谢谢!

I am very very new to my intro to java course and I was looking for help with an error that I was receiving. The error message is posted below along with with the actual code. Does anyone know why I am receiving this message and anyway to help me? The code is able 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() );
        }   
    }
}

错误信息:
(可惜我没能嵌入照片,所以我只需要键入了code所以这里是):

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.

这是什么这一切意味着什么呢?哪里控制台,我可以检查?

What does all of this mean? Where is the Console I can check?

推荐答案

我完全理解你正在尝试做的,
您试图分配下一个Employee对象到当前的一个,你写了code是语法错误的。

I completely understand what you are trying to do, You are trying to assign the next employee object to the current one, and the code you have written is syntactically wrong.

下面是code需要被改变

Here is the code that needs to be changed

arr[j] = ;

需要改变,以

arr[j] = arr[j+1];

这篇关于错误信息:诠释水湿转换为类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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