In this example we are sorting a char array. We have demonstrated two types of sorting in the program 1) Complete sorting using sort(char[] a)… [Read More]
Sort byte array in Java
This is the example of sorting a byte array in Java. Here we have done two types of sorting 1) complete sorting using sort(byte[] a)… [Read More]
Java – Finding minimum and maximum values in an array
In this example we are finding out the maximum and minimum values from an int array. class MinMaxExample { public static void main(String args[]){ int array[]… [Read More]
Random shuffling of an array in Java
import java.util.Arrays; import java.util.Collections; import java.util.List; class ShuffleArrayExample { public static void main(String[] args) { // String Array String[] stringArray = new String[] { “FF”,… [Read More]
Sort an Array in Descending (Reverse) Order – Java
The previous tutorial was all about sorting an array in ascending order. In this post we are going to learn how to sort an array… [Read More]
How to sort an Array in Java
This is the example of sorting an Array in java. Here we have two arrays, one is an integer array and another one is a… [Read More]
Final method parameters in java
In the last tutorial we discussed about final keyword. In this post we are gonna discuss about final method parameters. You must have seen the… [Read More]
How to remove only trailing spaces of a string in Java
In this tutorial we will learn how to trim trailing spaces from the string but not leading spaces. Here is the complete code: class TrimBlanksExample… [Read More]
java – Left padding a String with Spaces and Zeros
In this tutorial we are gonna see how to left pad a string with spaces and zeros: 1) Left pad with spaces class LeftPaddingExample1 {… [Read More]
java – Right padding a String with Spaces and Zeros
In this tutorial we are gonna see how to right pad a string with spaces and zeros: 1) Right pad with spaces public class PadRightExample1… [Read More]
- « Previous Page
- 1
- …
- 39
- 40
- 41
- 42
- 43
- …
- 65
- Next Page »