I am new in java and this line of code is giving error

Asked

Viewed 80 times

-2

import javax.swing.Joptionpane; public class test { public Static void main(String[] args) { Joptionpane.Showmessagedialog(null,"sla"); System.Exit(0);

}

}

inserir a descrição da imagem aqui

1 answer

0

You put: Showmessagedialog, with the' uppercase:

Correct:

JOptionPane.showMessageDialog(null, "sla");

See the image of the code:

Imagem

  • Continue with the mistake :(

  • Unable to locate or load main test class

  • Class name must be equal to the name of your file.

  • Take a print of your editor’s screen and send it here, please.

  • Redo the project, but with the correct names, namely: class name, method names. Apparently, the eclipse is looking for a class called 'this''.

  • ok kkkk I messed up here, I’ll do it

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.