[英]Compiler throwing error as variable is not declared X++
我有以下一段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變量。
如您所見,該變量已在開始時聲明。 謝謝!
RentalInfo
類型不作為類存在。
這就是為什么錯誤在第4行第4列中。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.