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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:08:57+00:00 2026-06-14T20:08:57+00:00

Which would be the best way to write the same code in Java?: Array.Resize(ref

  • 0

Which would be the best way to write the same code in Java?:

 Array.Resize(ref DCamposGraficoOperaciones[index].DatosMeses, 12);

I have this code in C# and I have to put it on in Java. Thanks so much. I have a method called resizeDatosMeses in Java to resize the array but when I try to do it in this way:

DCamposGraficoOperaciones[index].getDatosMeses()=resizeDatosMeses(DCamposGraficoOperaciones[index].getDatosMeses(), 12)

I have a mistake which is: The left-hand side of an assignment must be a variable, please could you advice me?

Thanks so much

  • 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-14T20:08:57+00:00Added an answer on June 14, 2026 at 8:08 pm

    I suspect you want:

    DCamposGraficoOperaciones[index].setDatosMeses(
        resizeDatosMeses(DCamposGraficoOperaciones[index].getDatosMeses(), 12));
    

    You can’t assign to the result of a method call, which is what you were trying to do before.

    I would strongly encourage you to break this line into two separate statements – and also start following Java naming conventions, which would prohibit DCamposGraficoOperaciones as a variable name.

    Also, it’s not clear why you’re resizing an array to start with, but in both .NET and Java you may well be better off using a higher-level abstraction, e.g. List<T> in .NET or ArrayList<T> in Java.

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

Sidebar

Related Questions

Which is the best practice in this situation? I would like an un-initialized array
I have a dataset which is not set out the best way see a
I wanted to know which would be best suitable - EDM or reflection provider
I am trying to determine which implementation of the data structure would be best
Which version of Linux would be my best choice if I want to use
I would like to ask which is the best solution for integrating google maps
What would you suggest as the best server stack for a dedicated server which
I have a label which would display strings from 0 ft to say 999
I have no experience with relational databases and before I write C++ code to
Of course, I know the best answer is don't write your own cross-platform code,

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.