Re: scanner and int issue
You have declared omar as a String, and showInputDialog() will return you a String. Now a string is not a numeric value so you cannot say if(omar==2) which is what the compiler is grumbling about.
Now strings *are* associated with numeric values - "42" and "0x2A"with 42, "the only even prime" with 2 etc. And Java provides methods for the finding the first sort of association.
Basically you ought to declare another variable (an int) and use the string omar to give it the right value. And then use this int variable in the if condition. See Converting Between Numbers and Strings in Oracle's Tutorial for an example and discussion. Their example uses float rather than int, but the idea is the same.
Re: scanner and int issue
Re: scanner and int issue