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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:31:11+00:00 2026-05-26T20:31:11+00:00

Guys I’m a bit new in using java and i’m trying to write a

  • 0

Guys I’m a bit new in using java and i’m trying to write a program that will check the 2d array if it contains the value of 1d array.The second array is like a list of numbers and it will check the first array if they match.

array1[6]= {"a","b","c","d","e","f"}
array2[1][4]={{"a","b","c","d"}{"d","e","f","g"}}
array2[0]= rowcomplete ; // because it contain all the value a,b,c,d
array2[1]= incomplete; // because it only match d,e,f but not g

This is my code:

String array1[] = {"a","b","c","d","e","f"};
String array2[][] = {{"a","b","c","d"}, {"d","e","f","g"}};

for (int 2row = 0; 2row < array2.length; 2row++) {
  for (int 2column = 0;2column< array2[2row].length;2column++) {    
    for(int 1row=0; 1row < array1[1row].length();1row++) {
      if (array2[2row][2column].equals(array1[1row])) {
        System.out.println("complete"); 
      }
      else{

      }
    }
  }
}
  • 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-26T20:31:11+00:00Added an answer on May 26, 2026 at 8:31 pm

    An easy way to do that would be to use the Arrays class to transform your arrays into a List and the use the containsAll method, like this:

      String array1 []={"a","b","c","d","e","f"};
      String array2 [][] ={{"a","b","c","d"},{"d","e","f","g"}};
    
      List<String> array1AsList = Arrays.asList(array1);
    
      for (int i = 0; i < array2.length; i++) {
          List<String> array2rowAsList = Arrays.asList(array2[i]);
    
          if(array1AsList.containsAll(array2rowAsList)){
              System.out.println("row " + i + " is complete");
          }
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Guys, I'm trying to write xpath or css to find/click on list element All
Guys, I have a CSS Layout that I am using that has a header,
guys. I'm pretty new to both Silverlight and WCF. What I'm trying to do
Guys im trying to check/uncheck a checkbox based on the state check/uncheck of another
guys! I am write a simple program to send a message to a Game
guys, I'm trying to realize viewing comments on internet portal and I'm using UITableView.
Guys, I am using SQL Server 2000 and executing the sp_columns stored procedure to
guys which text editor is good for Rubyonrails? i m using Windows and i
Guys that is code copied from a book (Programming Windows 5th edition): #include <windows.h>
Guys, I am using dynamic programming approach to solve a problem. Here is a

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.