Skip to content

Exercise_12_06: wrong if statement #21

Open

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!");

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions