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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:03:46+00:00 2026-05-30T00:03:46+00:00

This is my code and im getting an unreachable statement error on it but

  • 0

This is my code and im getting an unreachable statement error on it but i do not know why.

public boolean Boardload(String[] args) throws Exception
{
    Robot robot = new Robot();
    Color color3 = new Color(114, 46, 33);
    Color color4 = new Color(180, 0, 0);

    {
        Rectangle rectangle = new Rectangle(0, 0, 1365, 770);

        {
            while(false)
            {
                BufferedImage image = robot.createScreenCapture(rectangle);
                search: for(int x = 0; x < rectangle.getWidth(); x++)
                {
                    for(int y = 0; y < rectangle.getHeight(); y++)
                    {
                        if(image.getRGB(x, y) == color3.getRGB())
                        {
                            return true;
                        }
                    }
                }
            }
        }
        return false;
    }
} 

the exact error is:

java:68: unreachable statement
         {
         ^

Help would be nice, this code is supposed to loop until the pixel is found.

  • 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-30T00:03:47+00:00Added an answer on May 30, 2026 at 12:03 am

    I think the problem is that your loop is

    while(false) {
    

    This loop never executes, because false != true. Consequently, the Java compiler is telling you that nothing in the body of the loop will ever execute, and hence it’s unreachable.

    Try changing your loop to

    while (true) {
    

    (the idiomatic “loop forever”) and see if that fixes things.

    Hope this helps!

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

Sidebar

Related Questions

I am getting a StackOverflow Error in this code: EDIT [XmlAttribute(ID)] public string ID
I'm not sure why I'm getting this error, but shouldn't this code compile, since
i am using this code <a onclick=javascript:var t=setInterval(GetUpdates(5,ajaxResult),300);>GetUpdates</a> but getting the syntax error
i m new to iphone ... trying this code but getting some error help
I am getting segmentation fault in this code but i cant figure out why.
I am using this php code: exec(unrar e file.rar,$ret,$code); and getting an error code
please try this link for getting my code. its working in all browsers not
hi i hav a code like this in the end i m getting error
I'm having some trouble getting this code to compile on Linux but it works
Anybody can help me with this code I am getting this error message: Server

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.