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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:37:13+00:00 2026-06-06T17:37:13+00:00

I put off asking this as it must be something daft and, given it

  • 0

I put off asking this as it must be something daft and, given it was also me who asked this, I hesitated and have spent the last few hours getting increasingly frustrated:
Last line of for loop executed twice?

I think it might be a similar sort of oversight.

I also found this, which deals with a similar problem:
Java Exception printing twice

but still can’t seem to fix mine.

Here is a snippet from one class:

switch (Integer.parseInt(oc, 16)) 
{
  case 0x0F:
  ccrFlagState.zBit(true);
  break;
}

Which calls this snippet in another:

public boolean zBit(boolean set) {

    if (set = true) {
        System.out.println("Z set in CCR class");
    }
    return set;
}

When I input 0F the console prints Z set in CCR class twice.

Can anyone point me in the right direction as to why? Thanks, Robert.

-EDIT-
I should add that I get the same result with:

if (set)

and

if (set == true)
  • 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-06T17:37:15+00:00Added an answer on June 6, 2026 at 5:37 pm

    This is not reproducable for me. This code only pints it out once. Please provide more code …

    public static void main(String[] args) {
        String oc = "0F";
    
        switch (Integer.parseInt(oc, 16)) {
          case 0x0F:
              zBit(true);
              break;
        }
    }
    
    
    public static boolean zBit(boolean set) {
        if (set) {
            System.out.println("Z set in CCR class");
        }
        return set;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been wondering about this, which is why I have put off learning
How do I put off attribute access in Python? Let's assume we have: def
I have for a long time put off fixing up the lighting in a
Put value as a field makes sense only if this one represents some object's
I put together this quick carousel that I'm using to cycle through different divs
I'm looking into experimenting with Tao but I am somewhat put-off by its dead-looking
I have the following code in a UIView subclass that will move it off
I have a site that people put stuff for sale on. Every month, every
This question is a spin-off/evolution of this question . (That question got marked as
This might be a doozy of a question or I might be asking too

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.