Core Java Programming Challenges #28 | Coding Challenges | Naresh IT

preview_player
Показать описание
Core Java Programming Challenges #28 | Coding Challenges | Naresh IT

💡 Also Watch

Java Programming Tutorials by Mr.Hari krishna:
Advanced Java Programming Tutorials by Mr.Nataraj:

Subscribe to our channel and hit the bell 🔔🔔🔔 icon to get video updates.

💡 Visit Our Websites
#CoreJava_Programing #Challenges #CoreJava #Quiz
--------------------------

💡 About NareshIT:

"Naresh IT is having 14+ years of experience in software training industry and the best Software Training Institute for online training, classroom training, weekend training, corporate training of Hadoop, Salesforce, AWS, DevOps, Spark, Data Science, Python, Tableau, RPA , Java, C#.NET, ASP.NET, Oracle, Testing Tools, Silver light, Linq, SQL Server, Selenium, Android, iPhone, C Language, C++, PHP and Digital Marketing in USA, Hyderabad, Chennai and Vijayawada, Bangalore India which provides online training across all the locations

--------------------------

💡 Our Online Training Features:
🎈 Training with Real-Time Experts
🎈 Industry Specific Scenario’s
🎈 Flexible Timings
🎈 Soft Copy of Material
🎈 Share Videos of each and every session.

--------------------------

💡 Please write back to us at

--------------------------

💡 Check The Below Links

Рекомендации по теме
Комментарии
Автор

public class chal28 {


public static void main(String[] args) {
int count=0;
int a[]= {10, 20, 30, 40, 50};
int b[]= {30, 40, 50, 20, 10};

for(int i=0;i<a.length;i++) {
for(int j=0; j<b.length; j++) {

if(a[i]==b[j]) {
count++;
}
}
}

if(count==a.length)
{
System.out.println("Arrays is same");
}
else {
is not same");
}

}
}

rohitjaiswal
Автор

public class Challenge28 {
public static void main(String[] args) {
int a[] = {4, 7, 9, 0, 8};
int b[] = {7, 9, 0, 4};
int count=0;
for(int i=0;i<a.length; i++){
for(int j =0; j<b.length; j++){
if(a[i] == b[j]){
count++;
}
}
}
if(count == a.length)
System.out.println("The two arrays are equals");
else
System.out.println("The two arrays are not equals");
}
}

samahmahdi
Автор

class Test
{
public static void main(String[] args)
{
int flag=0;
int a[]= {11, 23, 45, 76, 87, 39};
int b[]= {23, 11, 39, 87, 76, 45};


{

for(int i=0;i<a.length;i++)
{
for(int j=0;j<b.length;j++)
{
if(a[i]==b[j])
{
flag++;

}
}

}
if(flag==a.length)
{

System.out.println("Array having same elements");
}
else
{
System.out.println("Array are not having same elements");
}

}
else
{
System.out.println("Array are not equal in length or any of them are null");
}
}

}

sreedharkamera
Автор

public class Test{

public static void main(String[] args)
{
int[] a={1, 2, 3, 4, 5, 6};
int[] b={6, 5, 4, 3, 2, 1};
int temp;
for (int i=0;i<a.length;i++)
{
for(int j=i+1;j<a.length;j++)
{
if(a[i]>a[j])
{



}
}
}

for (int i=0;i<b.length;i++)
{
for(int j=i+1;j<b.length;j++)
{
if(b[i]>b[j])
{



}
}
}

boolean isSame=true;
for(int i=0;i<a.length;i++)
{

if(a[i]!=b[i])
{
isSame=false;
break;
}

}

if (isSame) {
System.out.println("Both arrays have the same elements.");
} else {
System.out.println("Both arrays have different elements.");
}

}
}

PankajDeulkar-gs
Автор

Can anyone provide the code for this program.

AnjaliKumari-kusn
Автор

import java.util.*;
public class Test{
public static void main(String [] args)
{
Scanner sc = new Scanner(System.in);
int array1[]= {1, 2, 3, 4, 5, 6, 7};
int array2[]= {1, 2, 3, 4, 5, 6, 7};


System.out.println(Arrays.equals(array1, array2));

}

}

nishantraj
welcome to shbcf.ru