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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:37:08+00:00 2026-06-02T02:37:08+00:00

I am trying to understand if it is useful to use String during programming,

  • 0

I am trying to understand if it is useful to use String during programming, there is general notion in our group that using String is bad practice and enum is way to go but I am not able to find enough reasoning to give in my vote against String and would appreciate any thoughts and example on the issue?

Update:

I should re-phrase my question to word like under what situation usage of String is evil and what alternative dataType you should be using for the same.

  • 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-02T02:37:09+00:00Added an answer on June 2, 2026 at 2:37 am

    String is useful and the best way to represent textual data. Strings should not be used to represent:

    • enumerable, related constants (use enum). E.g. no "cm", "mm", "km" as units. Use a Unit enum with these elements. Unit.cm, etc.
    • numbers (use int, double, etc.)
    • dates (use Date, Calendar or joda-time DateTime)
    • passwords – use char[] instead, as strings are handled differently by the JVM and the sensitive information may become accessible to an attacker.
    • binary content. If you have a byte[], you should not use a new String(bytes) to transfer it – you can loose information that way. Strings can represent binary content, if it is encoded – in Base64, Hex, etc.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I trying to understand if a isset is required during form processing when i
Just trying to understand that - I have never used it before. How is
I'm trying to understand if it's possible to create a set of variables that
I'm trying to understand how to use the jQuery address plugin for handling deep
I'm trying to understand and really pinpoint when to use progressive download vs. rtmp
Would Devise still be useful if I'm using sign on with google? that is,
I'm trying to find some useful Open Source Testing Automation Tools for use with
I'm trying to understand how to use Wireshark right now, but the official manual
I'm trying to understand when to use an entity parent on GAE. Is this
I'm trying to understand the basics of practical programming around character encodings. A few

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.