All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.
ai is a reference of type AmazingInterface. It cannot used access AmazingClass.value field.
Why? I absolutely don't understand this, AmazingClass.value is just a static field. Compiler says: "Expected 1 arguments but found 2". Maybe ai cannot use AmazingClass's amazingMethod?
You are right. ai is a reference of type AmazingInterface but AmazingInterface does not have an amazingMethod with two parameters. That is the cause of compilation failure.
Fixed.
thank you for your feedback!
If you like our products and services, please help us by posting your review here.
value is a static field of AmazingInterface. To access this field, you need to either use the interface name, i.e. AmazingInterface.value or import the interface statically.
the explanation does not agree with the compiler's error cause:
Error:(19, 48) java: reference to value is ambiguous
both variable value in AmazingClass and variable value in AmazingInterface match