Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4534620
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T14:18:12+00:00 2026-05-21T14:18:12+00:00

This is a homework question that I am having a bit of trouble with.

  • 0

This is a homework question that I am having a bit of trouble with.

Write a recursive method that determines if a String is a hex number.
Write javadocs for your method.
A String is a hex number if each and every character is either
0 or 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9
or a or A or b or B or c or C or d or D or e or E or f or f.

At the moment all I can see to test this is if the character at 0 of the string is one of these values he gave me then that part of it is a hex.

Any hints or suggestions to help me out?

This is what I have so far: `

public boolean isHex(String string){


    if (string.charAt(0)==//what goes here?){
        //call isHex again on s.substring(1)
    }else return false;
    }

`

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T14:18:13+00:00Added an answer on May 21, 2026 at 2:18 pm

    Since this is homework, I only give some hints instead of code:

    Write a method that always tests the first character of a String if it fulfills the requirements. If not, return false, if yes, call the method again with the same String, but the first character missing. If it is only 1 character left and it is also a hex character then return true.

    Pseudocode:

    public boolean isHex(String testString) {
    
    
       If String has 0 characters -> return true;
    
       Else
    
          If first character is a hex character -> call isHex with the remaining characters
    
          Else if the first character is not a hex character -> return false;
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm stuck with this Java homework question: Write a new method, Refund, that simulates
I've been thinking about this homework question for a bit now. Given an number
I'm having problems with a homework question. Write a function, to_str(a), that takes an
This isn't actually a homework question per se, just a question that keeps nagging
First I want to make it clear that this is a homework based question.
I want to list all integers that divide n. This is a homework question.
Here is my homework question: Write a program that asks for a film name
This is a homework question, and I'm asked to show that 8 element Binary
First off, this is a homework question so vector libraries and string libraries are
I admit this is a homework question that asks if this is possible. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.