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

preview_player
Показать описание
Core Java Programming Challenges #26 | 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 Challenge24 {

public static void main(String[] args) {
int[] ar = {11, 23, 45, 76, 87, 39};
int[] arr = {13, 23, 49, 76, 98, 42};

for(int i = 0;i<ar.length;i++)
{
for(int j = 0;j<arr.length;j++)
{
if(ar[i]==arr[j])
{

}
}
}

}

}

SunilKumarSunil
Автор

public class Test {
public static void main(String[] args){
int[] a = {11, 23, 45, 76, 86, 39};
int[] b = {13, 23, 49, 76, 98, 42};

Set<Integer> setA = new HashSet<>();
Set<Integer> result = new HashSet<>();

for(int i = 0; i<a.length; i++){
setA.add(a[i]);
}
for(int j = 0; j <b.length; j++){
if(setA.contains(b[j])){
result.add(b[j]);
}
}
System.out.println(result);
}
}

MaulikSakhida
Автор

class Challenge26
{
public static void main(String[] args){
int a[]={13, 23, 45, 76, 87, 39};
int b[]={13, 23, 48, 76, 98, 42};
for(int i=0;i<a.length;i++){
for(int j=0;j<b.length;j++){
if(a[i]==b[j]){
System.out.println(b[j]);
}
}
}

}
}

srinivasvenkata
Автор

public class Challenge26 {
public static void main(String[] args) {
int a[]={11, 23, 45, 76, 87, 39};
int b[]={13, 23, 49, 76, 98, 42};
for(int i=0;i<a.length;i++){
for(int j=0;j< b.length;j++) {
if (a[i] == b[i]) {

System.out.println(a[i]);
break;


}

}

}

}
}

mdadilraza
Автор

import java.util.*;
class Intersection
{
public static void main(String[]aaa)
{
int[]a = {11, 22, 33, 44, 55, 66};
int []b = {12, 22, 45, 44, 56, 23};
for(int i=0;i<a.length;i++)
{
for(int j=0;j<b.length;j++)
{
if(a[i]==b[j])
{
HashSet h = new HashSet();
h.add(a[i]);
System.out.print(h);
//we can also use this line //System.out.print(a[i]);
}
else{}
}
}
}
}
//Please correct this code if you find the mistake. it's working but how to return the intersect
ed
// elements into a single set of array.

gsrcreations
Автор

import java.util.ArrayList;

public class Challenge26 {
public static void main(String[] args) {
int a[] = {3, 5, 7, 1, 2, 0};
int b[] = {3, 5, 8, 11};
ArrayList<Integer> intersection = new ArrayList<>();
for(int i=0;i<a.length; i++){
for(int j=0; j<b.length; j++){
if(a[i] == b[j])
intersection.add(a[i]);
}
}
System.out.println("The intersection : "+intersection);
}
}

samahmahdi
Автор

Hello Srinivas sir.. Pls explain the challenges with code on the next day of posting questions.. I think it's better..

sumanth