I received an error state that "actual argument String cannot be converted to char by method invocation conversion". How can I fix the error? Thank you..
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
I received an error state that "actual argument String cannot be converted to char by method invocation conversion". How can I fix the error? Thank you..
Last edited by Akirien; August 25th, 2012 at 11:31 PM.
Hello Akirien!
The g method's signature indicates that it takes a char parameter. But in your main method you invoke g passing it a String ("Good"). You need to pass it a char parameter to fix the error.
If you actually want it to take a String parameter then you need to 'say' it in the g's signature.
Hope it helps.