Skip to content

Exercise_12_06: wrong if statement #21

@tony1ee

Description

@tony1ee

the [if statement] to judge if the input is a hex number seems wrong. "11" will be decided to be a non-hex number.
here is my if statement just for your reference:

if ((hexChar-'0'<0||hexChar-'9'>0)&&(hexChar-'A'<0||hexChar-'F'>0)) throw new NumberFormatException (
	    		  "Not a hex number!");

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions