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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:18:00+00:00 2026-05-18T04:18:00+00:00

First off, I’m not asking for anyone to do my homework. I’m simply confused

  • 0

First off, I’m not asking for anyone to do my homework. I’m simply confused with this Java Syntax.

Below is the assignment description and two classes I have to implement. The first one is here for reference only. The second one is the one I’m having trouble with.

Being able to program with numbers that do not (in theory) have a maximum value is a necessity in many applications of computer science. You are going to write a series of classes to get started on this task. Your final class will allow you to represent and at least add Binary numbers of arbitrary length.

// You are to write (implement) this class exactly as dictated by the following list of class members.
public abstract AbstractBit: 

  private boolean bit;

  public abstract AbstractBit clone(); 
  public abstract AbstractBit addBits(AbstractBit guest);
  public abstract AbstractBit addBits(AbstractBit guest1, AbstractBit guest2);
  public abstract AbstractBit carryBit(AbstractBit guest);
  public abstract AbstractBit carryBit(AbstractBit guest1, AbstractBit guest2);

  protected void setBit(boolean value)

  public boolean getBit()

  public AbstractBit()

  public AbstractBit(boolean value)

  public AbstractBit(AbstractBit guest)

  public boolean equals(AbstractBit guest)

  public String toString()

What the heck are these?

Why am I adding static class variables of type BinaryBit? Isn’t this going to be recursive in some way? (See the lines marked with ????)

// You are to write (implement) this class exactly as dictated by the following list of class members.
public BinaryBit extends AbstractBit: 

  public static final BinaryBit zero = new BinaryBit(false);  // ????
  public static final BinaryBit one = new BinaryBit(true);    // ????

  public BinaryBit()

  public BinaryBit(boolean bit)

  public BinaryBit(int bit)

  public BinaryBit(BinaryBit guest)

  public BinaryBit clone()

  public boolean equals(BinaryBit guest)

  public String toString()

  public AbstractBit addBits(AbstractBit guest)

  public AbstractBit addBits(AbstractBit guest1, AbstractBit guest2)

  public AbstractBit carryBit(AbstractBit guest)

  public AbstractBit carryBit(AbstractBit guest1, AbstractBit guest2)
  • 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-18T04:18:01+00:00Added an answer on May 18, 2026 at 4:18 am

    A bit has only two possible values — zero and one. Any given zero or one is just as good as any other. Therefore, why not create a “canned”, unchangeable zero and one value, and just pass references to those values around? It saves memory and processor time. You might see this approach called the Flyweight pattern.

    You can see some of that pattern in Java’s own BigInteger class, with predefined values for common numbers like ZERO, ONE and TEN.

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

Sidebar

Related Questions

First off, this is part of an extra credit homework, so please do not
First off, I know this is a base JS issue, not jQuery. I am
First off, please forgive the stupidness of this question but Im not from a
First off, either A) I'm not investigating into this hard enough or B) I've
First off, this is a homework question so vector libraries and string libraries are
First off, I'm coming (back) to Java from C#, so apologies if my terminology
First off I use this code to make the navigation bar always stay fixed;
First off tags wont work. I say this because i create 4 buttons all
First off, I am a complete noob. Please respond as if teaching this to
First off I want to say I saw a couple of posts on this

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.