-2

I am getting a variabledeclaratorID expected after this token error for my instantiation of myBag in the ShoppingCart constructor. I can't figure out why.

enter image description here

Tried following the IDE fix suggestions, tried googling for similar errors.

  • 1
    Misplaced annotation `@SuppressWarnings`: Annotations are meta-meta-objects which can be used to describe other meta-objects. Meta-objects are classes, fields and methods. ( see https://stackoverflow.com/questions/1372876/how-and-where-are-annotations-used-in-java ) . Place annotation above constructor assuming that was your intention. – Computable Jun 25 '23 at 07:38
  • This was it - thank you! I didn't realize that annotations can only describe meta objects. – Saad Mommandi Jun 25 '23 at 14:46
  • Please don't post images of code, errors, logs, or other text; see [ask] – Robert Jun 26 '23 at 04:27

1 Answers1

0

User 5f3bde39-70a2-4df1-afa2-47f61b comment to my post pointing out my error in the annotation placement was the issue.