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.

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

``````/**
* @(#)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));
}
}
``````

This `(!=p)` is not a statement/expression. What is "not equal to" p?

commented: Good Solution +1

do you mean (q!=p) instead of (!=p)

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.