Java Error class interface or enum excepted are the class of java error that occurred when a programmer placed a brace in improper place or braces are not properly closed.
In this Tutorial we want to describe you a code that explain you java error class or enum excepted ,For this we have a class name'InterfaceEnumexcepted',Inside the main method we have taken an instance of Date class.
Let us look to the method used in this class-
|calendar.getInstance||This method returns you a calendar object initialized with the current time and date.|
|setTime(date )||This method returns you the time set with the calendar date.|
|StringBuffer||This method is a mutable one that can be changed according to specified condition by calling a certain method.|
|append||This method returns you the concatenates the representation in string of any type of data in the end of the invoking of string buffer.|
|System.out.println||This is used to display the current date.|
|Tostring||Once the concatenation has been done, the compiler invoke to to String( ) that turn the modifiable StringBufer into a constant String.|
On the execution of the above code the compiler show a class,enum interface
is expected as braces are not properly closed.
Compiling 1 source file to /home/girish/NetBeansProjects/errors/build/classes|
InterfaceEnumexcepted.java:28: class, interface, or enum expected
We have 1000s of tutorials on our website. Search Tutorials tutorials on our website.
Posted on: November 3, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles