Hamit SehjalforHamit's Bloghamitblogs.hashnode.net·Dec 5, 2022How to Generate Random Numbers in JAVA?Getting Started!! There are three ways in Java to generate random numbers using the method and classes - Using the random() Method Using the Random Class Using the ThreadLocalRandom Class There is one more method ints() Method that is a part of ...Discuss·10 likes·57 readsJava
Anusha SPforanushasp07.hashnode.net·Sep 15, 2022Pattern Printing Logic with Example in JavaHey Reader, If you are into development and preparing for interviews and want to get good handson on loops, here is the solution. We will learn the logic to write any pattern questions and it's types. The contents of the blog include: Introduction o...Discuss·3 likes·55 readspatterns
Anusha SPforanushasp07.hashnode.net·Oct 13, 2022Java 8 - Interview Questions & Answers - 1Hey Reader, If you are preparing for a Java interview, then this article would be most useful. Since, after the continuous upgradation of Java versions, the interview questions also increasing. Here, I have listed the most useful and commonly asked ...Discuss·2 likes·56 readsHashnode
Swetha VechalapuforSwetha Vechalapu's blogswethavechalapu.hashnode.net·Apr 24, 2023Java Interview QuestionsCommand line arguments This program shows working example of command line arguments public class CommandLineArgument { public static void main(String[] args) { for(String t: args) { System.out.println(t); } } } ...DiscussJava
Suyash Kejriwalforsuyashkejriwal.hashnode.net·Mar 4, 2023Java Streams - map() vs flatMap()Introduction In this block, we will learn about map and flatMap methods in Java streams API. Both are very useful intermediate methods of Java 8, to perform transformation operations on a list. map() method used for transformation (e.g. converting l...DiscussJava 8Java
Mwaijohnfornjirumwainjirumwai.hashnode.net·Feb 23, 2023Common Java and Spring Boot Interview QuestionsJava Interview Questions: What is Java? Java is a programming language that was first released by Sun Microsystems in 1995. It is a high-level, class-based, object-oriented programming language designed to be portable, secure, and platform-independen...Discuss·27 readsSpringboot
Shohanur RahmanforShohanur Rahman's blogshohanur.hashnode.net·Feb 22, 2023Find the minimum sum contiguous subarraypublic class MinSumContiguousSubarray { public static void main(String[] args) { int[] arr = {3, -4, 2, -3, -1, 7, -5}; int[] minSubarray = findMinSumContiguousSubarray(arr); System.out.print("Minimum sum contiguous subarr...Discussjava interview questions
Shohanur RahmanforShohanur Rahman's blogshohanur.hashnode.net·Feb 22, 2023Find the Contiguous Subarray with Sum to a Given Value in an array.Brute Force Solution: public class ContiguousSubarrayWithSum { public static void main(String[] args) { int[] arr = { 4, 2, -3, 1, 6 }; int sum = 4; findSubarrayWithSum(arr, sum); } public static void findSubarray...Discussjava interview questions
Shohanur RahmanforShohanur Rahman's blogshohanur.hashnode.net·Feb 21, 2023java program to find Largest sum contiguous subarrayBrute Force Solution: public class LargestSumSubarray { public static void main(String[] args) { int[] arr = { -2, -3, 4, -1, -2, 1, 5, -3 }; int largestSum = findLargestSumSubarray(arr); System.out.println("Largest sum co...Discussjava interview questions
Shohanur RahmanforShohanur Rahman's blogshohanur.hashnode.net·Feb 21, 2023Java program to Search in a row wise and column wise sorted matrixBrute force solution public class SearchMatrix { public static void main(String[] args) { int[][] matrix = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}; int target = 5; boolean found = searchMatrix(matrix, target); if (found)...Discussjava interview questions
Suyash Kejriwalforsuyashkejriwal.hashnode.net·Feb 18, 2023How to Sort Map using Streams APIIntroduction Sorting a map of objects is a very common problem faced in Java. In this article, we will learn how to sort maps traditionally and then optimize them using Java 8 streams API. Traditional Approach For sorting a map using the traditional ...DiscussJava 8Java
Suyash Kejriwalforsuyashkejriwal.hashnode.net·Feb 18, 2023How to Sort List Using Streams APIIntroduction Sorting a list of objects is a very common problem faced in Java. In this article, we will learn how to sort list traditionally and then optimize it using Java 8 streams API. Traditional Approach For sorting a list using the traditional ...DiscussJava 8Java
Suyash Kejriwalforsuyashkejriwal.hashnode.net·Feb 5, 2023Java Streams APIIntroduction In this post, we will learn about Java Streams API and implement for Each and filter methods What are Java 8 Streams A Stream is a sequence of objects that support various methods which can be pipelined to produce the desired results. A ...Discuss·27 readsJava 8Java