java - String cannot be converted to char, how to fix it? -


it says "incompatible types: string cannot converted char" how fix it? here example. code image

this solution :

public class newmain {     public static void main(string args[]) throws parseexception {         scanner s = new scanner(system.in);         char yes;         {             system.out.println("hi");             yes = s.next().charat(0);         } while (yes == 'y'); // if u enter 'y' continue      } } 

to exit enter thing other 'y'


Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

java - How to provide dependency injections in Eclipse RCP 3.x? -