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

  • Home
  • SEARCH
  • 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 7686083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:23:56+00:00 2026-05-31T19:23:56+00:00

Say I have: p.size = packetLine[0]; // where packetLine is of type String[] and

  • 0

Say I have:

p.size = packetLine[0]; // where packetLine is of type String[] and element at that position is number represented by String

I don’t want always to write

Integer.parseInt 

 or reverse

String.valueOf

Eclipse gives propositions to correct the error, can I make it to advice to convert the values?

At the moment it suggests to change the type. I would like third proposition ‘Convert to Int’ or ‘Convert to String;

This is particularly annoying when repeating thousand times, I might just introduce my own method for converting like toInt or toString2, but in build solution would be better.

  • 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-31T19:23:57+00:00Added an answer on May 31, 2026 at 7:23 pm
    1. What you are asking for is not casting. Java uses the term casting for two operations:

      • Converting a numeric primitive to another numeric primitive by approximating the original value as much as possible e.g. int to double.

      • Storing the contents of an object reference variable to a more specific reference variable, if and only if the referred object can actually be stored there.

    2. What you are asking for is conversion from String to a primitive type and vice versa. It does not usually make sense to provide shortcuts for this. There are more than one ways to do it and none is universal. E.g. a numeric String can be interpreted as an octal or a hexadecimal number and a float can be converted to a String with a varying number of floating point digits, depending on the required precision…

    EDIT:

    You might be able to make your life easier with repeated operations by creating custom editor templates in Eclipse. Editor templates are accessible along with the rest of the content assist proposals when you press Control+Space. Template creation is not always straightforward, but it can be quite helpful in some cases.

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

Sidebar

Related Questions

Say I have an array of arbitrary size holding single characters. I want to
Many people have argued about function size. They say that functions in general should
Say I have the following for a bunch of items. item position item size
Let's say I have an array: string w[10]; and I have a statement: if(w.size()
Let's say I have an int that represents the number of rows in a
Say I have these two variables: size_t value; size_t size; And I want to
Say I have an email class that has the following properties: public string From
Say I have an array of size 5. I want to take an index
Let's say I have an array (of fixed size) that is shared between multiple
Say I have two files or arrays, type doesn't matter, with a size of

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.