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

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -