|
I'm really new to java and I am using the NetBeans program to write Java programs. I've already written 2 really easy program, but for some reason this one won't work. It's straight out of a programming book. This is what the netbeans is telling me:
project1/ifsample.java [17:1] '{' expected class project1.ifsample {{ ^ 1 error Errors compiling ifsample.
/* * ifsample.java * * Created on November 3, 2004, 6:39 PM */
package project1;
/** * * @author wayne */ public class ifsample { } class project1.ifsample {{ public static void main(String args[]) { int x, y; x = 10; y = 20; if (x< y) System.out.println("x is less than y") ; x = x * 2; if (x == y) System.out.println("x is equal to y") ; x = x * 2; if (x> y) System.out.println("x is now greater than y") ; if (x == y) System.out.println("you won't see this") ; } }}}
|