Java Compilation error interface or enum expected

When using Wordpad as a Text Editor for writing java programs and while compiling the java program the following error might be displayed if you had saved your .java file as rich text format file type.

samplehello.java:1: class, interface, or enum expected
{rtf1ansiansicpg1252deff0deflang16393{fonttbl{f0fswissfcharset0 Arial;}
}

This can be resolved by saving the file with Save as type Text Document using Save As option available in WordPad.

image

In Category: Java

Ravi Shankar

A Software developer and blogger who is always looking to provide technical help to the wider community.

Show 0 Comments
No comments yet. Be the first.

Leave a Comment

Get your free copies of the following tech guides by joining the Digital Answers mailing list.