Skip to content
← Back to Community
Profile icon

My first program gives an "Error" when I run it. Can anyone share what might be the problem?

I wrote my program in Notepad as the following:
Public Class HelloWorld {
Public static void main(String[] args) {

Then I saved it in a folder at the root of my C: drive and named the folder "Revature Programs".

I then opened my "Command Prompt" and changed the directory structure to where the file was saved as follows:

C:\Revature Programs>javac

Here's what I get back as a result: error: class, interface, enum, or record expected
Public class HelloWorld {
1 error

Profile icon