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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:05:34+00:00 2026-06-03T04:05:34+00:00

So I have a program that deals with bytes. Everything works, except one part.

  • 0

So I have a program that deals with bytes. Everything works, except one part. A for loop doesn’t execute at all.

This is the code…complex it is.

public int getID(int slot){
    int slots = 0;
    for(int a=0;a<b.length;a++){
        if(correctslot){ //condition not shown.
            if(slots==slot){
                System.out.println("found pair"); 
                for(int i=a;i<37;i++){
                    System.out.println("executing loop");
                    if(isID){ //condition not shown.
                        System.out.println("returning location");
                        return i+1;
                    }
                }
            }
            slots++;
        }
    }
    return 0;
}

If the program found a matching slot, it prints found pair. If it was executing the loop it prints executing loop, but that’s the part that doesn’t do anything at all. It prints the first string found pair but not the second executing loop. What did I do wrong?

  • 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-03T04:05:36+00:00Added an answer on June 3, 2026 at 4:05 am

    Debug a . I think a >= 37 by the time either correctSlot && slots == slot .

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

Sidebar

Related Questions

I have a program that works with a variety of files on both the
I have a program that only allows one instance of itself to run. I
I have a program that looks something like this: public partial class It {
I have to create a C# program that deals well with reading in huge
I have a program that deals with huge amount of data. The process is
I have a program that deals with (virtual) money order transactions, and there are
I have a program that deals with command line args being sent to the
Hi I have a program that deals alot with vectors and indexes of the
I have program that has a variable that should never change. However, somehow, it
I have program that runs fast enough. I want to see the number 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.