Am new to android Can anyone pls help correct the error Am t

Am new to android Can anyone pls help correct the error?

Am trying to run thid program and am getting this error :-

Error:(15, 9) error: class, interface, or enum expected

Error:(18, 9) error: class, interface, or enum expected

Error:Execution failed for task \':app:compileDebugJavaWithJavac\'.
> Compilation failed; see the compiler error output for details.

Here is my mainActivity code

Solution

I found no \" isHello\" declaration before, but you used it in

just have a look on it and modify it if needed.

you kept semicolon at the end of

.................................

..............................

};

here semicolon( ; ) is taken as an empty statement and is legal in Java.

though java allows semicolon at the end of the method(legal in java). But just have a try by removing it and execute it once.

I have gone through your program, I didn\'t find any errors. but I am telling you small possibilities that may cause Error: class, interface, or enum expected.

* improper balancing of curly braces{}

* you might have code or a { before the beginning of the class.

see whether any miss matching of brackets or curly braces in activity_main.XML

see any spelling mistakes occurred.(like \"classs\" instead of class or \"Public\" instead of public)


Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site