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 8987427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:47:24+00:00 2026-06-15T21:47:24+00:00

I am working on a Java application for my college class, and at one

  • 0

I am working on a Java application for my college class, and at one point in the program I am to ask the user to input an integer. I could just have the user input an integer, and if there is a problem, Like them putting in “abcdefg”, I could just have a try/catch statement with a loop. But a while back I created a custom class that takes care of this problem by itself calledInputValidator. It has a built in scanner and takes care of basically everything (checking to make sure it was actually an int, double, etc..) and in the main class you can simply set a value equal to one of the getter methods to make sure it is actually a valid input.

What I’m wondering is, do you think it would be considered “Lazy” of me by my professor, intuitive, or just unnecessary? This class could be useful for many things, but could also be considered “Wasting memory” (it also checks for double, and I in the program it just checks an int). I would like to use it, but I want to make sure this is a legitimate thing to do when it comes to programming in the classroom. Thank you in advance.

  • 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-06-15T21:47:26+00:00Added an answer on June 15, 2026 at 9:47 pm

    I’ve used my own classes for validating input as well. I don’t see it as a problem, it reduces the code you need to write elsewhere and you can let the class do the job for you. Your professor shouldn’t mind because he can clearly see you understand validating input.

    Here you can see the class I use.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been working on a Java application where I have to use JUnit for
I am working under java application which uses XSLT transformation. I have a lot
I have a working Flex/Java application, but if I log out of the channelSet
I have been working on a java application that has a connection to a
I'm working on a Java Swing application. I have a button whose action runs
I've been professionally working with Java application servers for five years, but I have
I have a decent working web application (Java/Servlet/Jsp) that I would like to improve
I'm currently working on a Java application which should have the capability to use
Im working on a java application that involves threads. So i just wrote a
I 'm working on a java application and in the program I use some

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.