Garmaine Staff asked 2 years ago
Closed. This question is off-topic. It is not currently accepting answers.

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 5 hours ago.

I wrote this code to check if char is a vowel

package ifstatement;

public class IfStatement {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        char ch='a';
        if(ch==a||ch==e||ch==i||ch==o||ch==u) {
            System.out.println("It is a Vowel.");
        }
        else {
            System.out.pirntln("It is not a Vowel.");
        }
    }

}

But i am getting this error:-

o cannot be resolved to a variable
u cannot be resolved to a variable
The method pirntln(String) is undefined for the type PrintStream

at ifstatement/ifstatement.IfStatement.main(IfStatement.java:8)