I’m trying to use switch on Java 6 with parameter type char 1
but I am getting an error “cannot convert char to string”,what am I doing wrong here?
public static void setRoot(Element rootTreeNode,char type ) {
switch (type) {
case "a":
I want that the case will be on char1.
Use Single quotes
' ', Double quotes are used to representString, andcharis represented in Java with Single quotes.