Could you give us the scope of this question? That would assist in providing an answer.
The error "'.class' expected"
refers to an event where the compiler identifies a type name where it expects an expression and thinks you are trying to refer to that type's class object. For example, putting a main()
method at the beginning of a PracticeIt question that asks for bare code returns this error, along with a slug of others:
Line 1, Column 34
'.class' expected
public static void main(String[] args) {
This error can be the result of a misplaced class call, or by the fact that the problem asks for bare code-- where the `public class
and
main
` methods aren't required. Check over the problem in question to make sure there aren't any silly mistakes.
Source: StackOverflow