How to Fix Java Error - class, interface, or enum expected - Error in Java | Java Tutorial

preview_player
Показать описание

Learn how to fix the java error "class interface or enum expected" in Java

Content

00:00 - Introduction
00:44 - What does Java Error Class or Interface Expected means
02:05 - How To Fix - Example #1
02:44 - How To Fix - Example #2
03:38 - How To Fix - Example #3
04:37 - How To Fix - Example #4

Want to become a software developer? Check out my blog for more tips and guidance:

My 100% Recommended python books:

Hope you enjoy the video and Happy coding! :)
Рекомендации по теме
Комментарии
Автор

i like your slow and very easy way of explanation. i just subscribed. thanks

PrinceJeniFX
Автор

I am going through Enums that were introduced in Java 1.5. In Effective Java 2'nd Edition it's mentioned that before Java 1.5 there were int and String enum patterns which were having some deficiencies.

I understood the cons of int enum patterns but while going through String enum patterns I got the basic idea but didn't get the deep sense of below statements mentioned under Item30 in Effective Java:

This variant, known as the String enum pattern, is even less desirable. While it does provide printable strings for its constants, it can lead to performance problems because it relies on string comparisons. Worse, it can lead naive users to hard-code string constants into client code instead of using field names. If such a hard-coded string constant contains a typographical error, it will escape detection at compile time and result in bugs at runtime.

Can anyone help me in understanding what these lines explaining. I would appreciate if it can be explained with some code snippet.

Thanks

chungfup