I’m trying to convert a char to Character before it gets pushed on a stack but get a “cannot find symbol error”, I don’t see what the problem might be. This is how I pass the char to the stack:
stack.push(valueOf(in));
Where ‘in’ is a char.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
valueOfis a class method ofCharacter, among others. You can’t just call it without a class to hang it off.What you’re really looking for is
Character.valueOf(in)ornew Character(in).