Java Program to find Smallest Number in an Array9 Sept 2024 | 2 min read We can find the smallest element or number in an array in java by sorting the array and returning the 1st element. Let's see the full example to find the smallest number in java array. Test it NowOutput: Smallest: 1 Smallest: 22 Find Smallest Number in Array using ArraysLet's see another example to get the smallest element or number in java array using Arrays. Test it NowOutput: Smallest: 1 Smallest: 22 Find Smallest Number in Array using CollectionsLet's see another example to get smallest number in java array using collections. Test it NowOutput: Smallest: 1 Smallest: 22 Next TopicJava Programs |
Java program to print the following pattern *000*000* 0*00*00*0 00*0*0*00 000***000 Algorithm: STEP 1: START STEP 2: SET lines=4 STEP 3: Define i, j STEP 4: SET i =1 STEP 5: REPEAT STEP 6 to 15 UNTIL i <= lines STEP 6: SET j=1 STEP 7: REPET STEP 8 and 9 UNTIL j <= lines STEP 8: IF...
2 min read
In this section, we will learn what is sunny numbers and how to create a Java program to find the sunny numbers. We will also create a Java program to find all the sunny numbers between the specified range. Sunny Number A number is called a sunny number...
3 min read
Java Program to find Third Largest Number in an Array We can find the third largest number in an array in java by sorting the array and returning the 3nd largest number. Let's see the full example to find the third largest number in java array. public class...
2 min read
In this program, we will create a singly linked list and delete a node from the beginning of the list. To accomplish this task, we need to make the head pointer pointing to the immediate of the initial node which will now become the...
6 min read
Buzz number is another special number in Java that ends with digit 7 or divisible by 7. Unlike Prime and Armstrong numbers, the Buzz number is not so popular and asked by the interviewers. In simple words, a number is said to be Buzz if it ends...
3 min read
Java Convert Binary to Decimal We can convert binary to decimal in java using Integer.parseInt() method or custom logic. Java Binary to Decimal conversion: Integer.parseInt() The Integer.parseInt() method converts string to int with given redix. The signature of parseInt() method is given below: public static int parseInt(String s,int redix) Let's see...
2 min read
In this program, we will create a singly linked list and add a new node at the middle of the list. To accomplish this task, we will calculate the size of the list and divide it by 2 to get the mid-point of the list...
7 min read
In this section, we will learn what is a smith number and also create Java programs to check if the given number is smith or not. The smith number program frequently asked in Java coding tests and academics. Smith Number A Smith number is a composite number whose...
4 min read
Java Convert char to String We can convert char to String in java using String.valueOf(char) method of String class and Character.toString(char) method of Character class. Java char to String Example: String.valueOf() method Let's see the simple code to convert char to String in java using String.valueOf() method. char c='S'; String s=String.valueOf(c); Let's...
1 min read
In this program, we need to create a doubly linked list and rotate it by n node. This can be achieved by maintaining a pointer that starts from the head node and traverses the list until current points to the nth node. Move the list...
7 min read
We request you to subscribe our newsletter for upcoming updates.
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India