0

次のx++コードがあります。

static void Datatypes_class_variable(Args _args)
{
    // Declare a class variable from the RentalInfo class
    RentalInfo   rentalInfo;
    ;
    // An object is created and referenced by the
    // class variable rentalInfo
    rentalInfo = new RentalInfo();
    // Call methods to set/get data to/from the object
    rentalInfo.setCar("BMW 320");
    info(strfmt("The car is a %1", rentalInfo.getCar()));
}

コンパイラがエラーをスローする理由がわかりません:

RentalInfo 変数が宣言されていません。

ご覧のとおり、変数は既に最初に宣言されています。ありがとうございました!

4

1 に答える 1