Hey guys in this article, we will discuss finding the second largest number in array using Java. First, let’s look at the solution then I will explain the solution. Watch the Video Solution public class...
Category - Core Java Programs
Hey guys in this post, we will discuss the most popular sorting algorithm that is Counting sort in Java language. Read more: Check the Complete Java Tutorials Check the Complete Spring Boot Tutorials [100+ Examples] Check the...
Hey guys in this post, we will discuss the most popular sorting algorithm that is Heap sort in Java language. Read more: Check the Complete Java Tutorials Check the Complete Spring Boot Tutorials [100+ Examples] Check the...
Hey guys in this post, we will discuss the most popular sorting algorithm that is Selection sort in Java language. Read more: Check the Complete Java Tutorials Check the Complete Spring Boot Tutorials [100+ Examples] Check the...
Hey guys in this post, we will discuss the most popular sorting algorithm that is Quick sort in Java language. Read more: Check the Complete Java Tutorials Check the Complete Spring Boot Tutorials [100+ Examples] Check the...
Hey guys in this post, we will discuss the most popular sorting algorithm that is Radix sort in Java language. Read more: Check the Complete Java Tutorials Check the Complete Spring Boot Tutorials [100+ Examples] Check the...
Hey guys in this post, we will discuss the most popular sorting algorithm that is Merge sort in Java language. Read more: Check the Complete Java Tutorials Check the Complete Spring Boot Tutorials [100+ Examples] Check the...
Hey guys in this post, we will discuss the most popular sorting algorithm that is Insertion sort in Java language. Read more: Check the Complete Java Tutorials Check the Complete Spring Boot Tutorials [100+ Examples] Check the...
Following are the test cases Test cases Result Status haveThree({12,3,4,3,88,3}) true OK haveThree({22,3,3,3,17,3}) false OK haveThree({3,4,3,6,3,7}) true OK Java solution package test; public class Program20...
Following are the test cases Test cases Result Status sum28({10,20,30,40,50,60,2}) false OK sum28({2,10,7,2,2,2}) true OK sum28({5,6,1,2,2,2}) false OK Java solution package test; public class Program19 { public...
Following are the test cases Test cases Result Status nTwice(Hello,2) Helo OK nTwice(Chocolate,3) Choate OK nTwice(java,1) ja OK Java solution package test; public class Program18 { public static void...
Following are the test cases Test cases Result Status makeOutWord(<<>>,Yay) <<Yay>> OK makeOutWord([[]],Word) [[Word]] OK makeOutWord([((JAVA))] ((JAVA)) OK Java solution package...
Following are the test cases Test cases Result Status stringE(Hello) true OK stringE(Heelele) false OK stringE(Heelle) true OK Java solution package test; public class Program16 { public static void...
Following are the test cases Test cases Result Status tripleUp({1,2,3,7,5,9}) true OK tripleUp({1,4,5,6,2}) true OK tripleUp({1,2,4,5}) false OK Java solution package test; public class Program15 { public static...
Following are the test cases Test cases Result Status sumOfDigits(144) 9 OK sumOfDigits(457) 16 OK sumOfDigits(345) 12 OK Java solution package test; public class Program14 { public static void main(String[]...
Following are the test cases Test cases Result Status firstHalf(HelloThere) Hello OK firstHalf(abcdef) abc OK firstHalf(Word) Wo OK Java solution package test; public class Program13 { public static void...
Following are the test cases Test cases Result Status arrayFront9({1,2,9,3,4}) true OK arrayFront9({9,2,3,4,56}) true OK arrayFront9({2,3,4,5}) false OK Java solution package test; public class Program12...
Following are the test cases Test cases Result Status generateFibSeries(5) {0,1,1,2,3} Ok generateFibSeries(7) {0,1,1,2,3,5,8} Ok generateFibSeries(10) {0,1,1,2,3,5,8,13,21,34} Ok Java solution public class Program11...
Test cases Test cases Expected Result frontBack(abcd) dbca OK frontBack(Bee) eeB OK frontBack(MazE) EazM OK Java solution: public class Program10 { public static void main(String[] args)...
Test cases Test cases Expected Result searchElement({33,44,21,98,27,94},21) true OK searchElement({1232,432,546,980,984},980) true OK searchElement({3,4,9,87,29},2) false OK Java solution: public class Program9...
Test cases Test cases Expected Result arraySum({5,5,5,5,5}) 25 OK arraySum({1,3,4,7,8}) 23 OK arraySum({100,200,300}) 600 OK Java solution: public class Program8 { public static void main(String[] args) { int a[]...
Test cases: Test cases Expected Result countConsonents(instanceof is for references only) –>[18] 18 OK countConsonents(Object Oriented) –>[8] 8 OK countConsonents(Design Patterns88)...
Test cases: Test cases Expected Result countVowels(instanceif is for references only) 11 OK countVowels(Object Oriented) 6 OK countVowels(Design Patterns) 4 OK Java solution: public class Program6 { public static...
Test cases: Test cases Expected Result stringConcat(Hello,World) Hello World OK stringConcat(Code,ranch) Code ranch OK stringConcat(Web,Application) Web Application OK Java solution: public class Program5 { public...
Test cases: Test cases Expected Result or35(15) true OK or35(8) false OK or35(12) true OK Java solution: public class Program4 { public static void main(String[] args)...
Test cases: Test cases Expected Result isDivisibleBy7(17) false OK isDivisibleBy7(77) true OK isDivisibleBy7(12) false OK Java solution: public class Program3 { public static void main(String[] args)...
Test cases: Test cases Expected Result testOddEven(12) even OK testOddEven(3) odd OK testOddEven(-55) odd OK Java solution: package test; public class Program2 { public static void main(String[] args)...
Test cases: Test cases Expected Result sum(10,12) 22 OK sum(1,2) 3 OK sum(2147483647,1) 2147483648 OK Java solution: public class Sum { public static void main(String[] args) { Sum.sum(10, 12); Sum.sum(1...
Print matrix in Z form. Input: mat[][] = {1, 2, 3, 4, 5, 6, 7, 8, 9} Output: 1 2 3 5 7 8 9 public class PrintTheMatrixOrder { public static void printTheMatrix(int mat[][]) { for (int i = 0; i < mat.length; i++)...
Print all jumping numbers smaller than or equal to x. Input: x = 105 Output: 0 1 2 3 4 5 6 7 8 9 10 12 21 23 32 34 43 45 54 56 65 67 76 78 87 89 98 101 Note: A number is called as a jumping number if all adjacent digits in it...