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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:37:45+00:00 2026-05-30T15:37:45+00:00

if (a != 1 && solone == (int)solone && soltwo == (int)soltwo){ // (lx+o)(mx+p)

  • 0
if (a != 1 && solone == (int)solone && soltwo == (int)soltwo){
    // (lx+o)(mx+p)
    int h = (a*c);
    List<Integer> factors = new ArrayList<Integer>();
    for (int i = 1; i < Math.sqrt(h); i++) {
        if (h % i == 0)
            factors.add(i);
    }
    Integer result = null;
    for (int ii: factors) {
        if (b == ii + h/ii){
            result = ii;
            // ax^2+hiix+iix+c
    }
    int hii = h/ii;
    int gcd1 = Euclid.getGcd(a, hii);
    int gcd2 = Euclid.getGcd(ii, c);
    String Factored = FactoredForm.getFF(gcd1, gcd2, a, hii);
}

My String called Factored is one I need to use for printing later in my code. I can’t use it because it doesn’t recognize the variable outside of the for loop. How do I go about making it public? When i added public in front of the string, it said that only final is permitted? Also, I cannot simply move the extraneous code outside of the for loop because it all depends on the integer “ii” which is part of the loop. Help!

  • 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-30T15:37:46+00:00Added an answer on May 30, 2026 at 3:37 pm

    Do you really want this to be part of the state of an instance of the class? If so, declare it outside the method:

    private string factored;
    
    public void Whatever(...)
    {
        factored = FactoredForm.getFF(gcd1, gcd2, a, hii);
    }
    

    I would advise you not to make it public. If you need to expose the value, do so via a property.

    Think carefully about whether it really is logically part of the state of this class though. Also revisit naming conventions, as mentioned before.

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

Sidebar

Related Questions

int& fun() { int * temp = NULL; return *temp; } In the above
Is there a quick & dirty way of obtaining a list of all the
Ladies & Gentlemen, I´m new to Java, forgive me if it´s obvious, but I
& has && . | has || . Why doesn't ^ have ^^ ?
& Eacute ; \u00C9 & egrave ; \u00E8 & eacute ; \u00E9 & apos
&nbsp; shows some symbol istead of space in IE? could you tell me why?
K&R C Programming Language: pg. 105 Extend entab and detab to accept the shorthand
Thanks to a Q&A on stackoverflow. I just found out how to determine the
When I drag & drop a dll to the assembly folder on vista, I
Possible Duplicate: Pre & post increment operator behavior in C, C++, Java, & C#

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.