Hi, can anyone help me?
I am having trouble with an application I have to make, but I recently started with Java, so I am not very good at it.
For your information, it is an application, made with JCreator.

At lines: 21, 26 ,31 and 36 it states that there is an illegal start of the expression.
Please help!

/**
 * @(#)project2.java
 *
 * project2 application
 *
 * @author 
 * @version 1.00 2009/9/8
 */

public class project2 {

    public static void main(String Args[]) {

            System.out.println("P\t\tQ\tAnd\tOR\tXOR\tNOT");
        int p;
        int q;

        p = 0; q = 0;
        System.out.print(p + "\t" + q +"\t");
        System.out.print((p&q) + "\t" + (p|q) + "\t");
        System.out.println((p^q)+ "\t" + (!=p));

        p = 0; q = 1;
        System.out.print(p + "\t" + q +"\t");
        System.out.print((p&q) + "\t" + (p|q) + "\t");
        System.out.println((p^q)+ "\t" + (!=p));

        p = 1; q = 0;
        System.out.print(p + "\t" + q +"\t");
        System.out.print((p&q) + "\t" + (p|q) + "\t");
        System.out.println((p^q)+ "\t" + (!=p));

        p = 1; q = 1;
        System.out.print(p + "\t" + q +"\t");
        System.out.print((p&q) + "\t" + (p|q) + "\t");
        System.out.println((p^q)+ "\t" + (!=p));
    }
}

Edited 3 Years Ago by mike_2000_17: Fixed formatting

Try to use code tag in the future like this.

class Test
{
public static void main(String args[])
{
System.out.println("Hello, How are you?");
}
}

It will make your post very neet.
And make other to understand properly and reply instantly.

:zzz: Good Luck. :P

Only problem is with

System.out.println((p^q)+ "\t" + (!=p));

line.
!=p is not a statement. You are trying to compare p with another variable to determine whether they are not equal.
q!=p would solve the problem.

This article has been dead for over six months. Start a new discussion instead.