-
help with java coding
This is my second coding in java...
I have problems with the joptionpane line.... I copied it exactly from the book like this:
Code:
//This is my class (container) name
public class EG02
{
//main method (function)
public static void main(String[] args)
{
String input;
input = JOptionPane.showInputDialog ("What's your name?");
if(input.equals("FUCK YOU BITCH"))
{
System.out.println("Congratulations!");
} else
{
System.out.println("Sorry, you lose!");
}
}
}
-
copied it exactly eh lol? What book are you using?
You need to import javax.Swing.JOptionPane;
-
wow, your a genius. I didn't copy it directly. I thought I did...
Thanks.
Book is Programming Video Games for the Evil Genius by Ian cinnamon
-
No worries. I was laughing about the expected name to be input, but judging by the title that might actually be in the book.
-