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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:09:35+00:00 2026-06-13T02:09:35+00:00

I have two arraylists: a1 = {1, 0, 0, 1, 0, 0,} and a2

  • 0

I have two arraylists: a1 = {1, 0, 0, 1, 0, 0,} and a2 = {0, 1, 1, 0, 0, 0}. I need to compare the elements of both the arraylists so I can come up with a3 = {1, 1, 1, 1, 0, 0}.

a3 is based on the Logical disjunction operation where it produces a value of true if at least one of its operands is true.

need help here…

  • 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-13T02:09:36+00:00Added an answer on June 13, 2026 at 2:09 am

    Probably there could be better solutions, but the following should work for you:

    public static void main(String[] args) {
            Integer[] a = new Integer[] { 1, 0, 0, 1, 0, 0 };
            List<Integer> a1 = Arrays.asList(a);
            Integer[] b = new Integer[] { 0, 1, 1, 0, 0, 0 };
            List<Integer> a2 = Arrays.asList(b);
            List<Integer> a3 = new ArrayList();
            for (int i = 0; i < a1.size(); i++) {
                a3.add(a1.get(i) | a2.get(i));
                System.out.print(a3.get(i));
            }
        }
    

    Output:

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

Sidebar

Related Questions

I have two arrays (or arraylists if it is easier) of strings. I need
Possible Duplicate: How to compare two arraylist? I have two String ArrayLists of different
I have one problem, I need to compare two arrays and I want to
I have a two dimensional ArrayList that I need to filter the duplicates out
I have two arrayLists and I am trying to subtract one arrayList from another.
So we have a java class with two ArrayLists of generics. It looks like
I'm pretty new to Android and I need some guidance. I have two activities
I have two ArrayLists, each holding blocks of certain size: blockList, eraserList. Blocks are
I have two arraylists that contains links in one and the root url in
i need to make an array of arraylists of an object. i have tried

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.