How to decode Id Token in java Id Token generated by the authorization server which contains the user information and authorization server details. Here I am sharing the java example program to decode the Id Token. Pre-Requisites java 1.8 Eclipse Create java maven project in eclipse the add the following pom.xml and java file into […]
Category: Java Concepts
Java Concepts
How to import jar as a project in eclipse
How to install Java De-Compiler
How to install Java De-Compiler Java decompiler is very important to decompile the .class file into a .java file which is plain text file. So In this article, I am going to show how to install Java De-Compiler in windows and Linux/Unix systems. There are 2 ways to install java -decompiler in the systems JD-GUI […]
Sorting List by using Comparator Interface
Sorting List by using Comparator Interface In this article, I am going to explain the Sorting List by using Comparator Interface. Objects Type List can be sorted by using a Comparator interface. By using comparator we can sort the list of objects by a single field or multiple fields either in ascending order or descending […]
How to Sort a List By Using Comparable Interface
How to Sort a List By Using Comparable Interface In this article, going to explain How to Sort a List By Using Comparable Interface. Wrapper Class type List can be sorted by using the Collection.sort() method but the List type is Object then we have to use comparable interface to sort. Example Create VO Class […]
How to sort a List in java
How to sort a List in java In this article, explaining how to sort a list in java. We can sort list which contains Primitive data types or Wrapper Class Types by using Collections.sort(list) or list.stream().forEach(); We can’t sort list which contains object data types so that we have to use a comparator or comparable […]
Arrays Sorting
Arrays Sorting In this article, I am going to show, how to sort arrays in java. Arrays.sort(), Arrays.parallelSort() and Collections.sort(Arrays.asList()) methods are using to sort any type of arrays. String array int array short array long array double array float array char array Pre-Requisites Java 1.8 Eclipse IDE Maven String Array Example Arrays.sort(new String[] { […]
Comparator List Sorting
Comparator List Sorting In this example showing how to sort objects in the List by using a comparator. Primitive Type List, Wrapper Classes Type List can be sorted by using the Collection.sort(), but Object type List can’t be sorted. To achieve this we can use either Comparator and Comparable. Comparator A Comparator interface is […]
How to sort primitive data in the list
How to sort primitive data in the list There is a list having primitive data, then how to sort the data in the list. List – Integer Data Type ListIntegerSorting.java package com.narayanatutorial.primitive.sorting; import java.util.ArrayList; import java.util.Collections; import java.util.List; public class ListIntegerSorting { public static void main(String args[]) { List<Integer> list = new ArrayList<Integer>(); list.add(123); […]
How to check Java Heap Memory in windows system
Find Minimum Heap Memory Open windows command prompt and then enter the following command. javaw -XX:+PrintFlagsFinal | find “InitialHeapSize” Ouput Find Maximum Heap Memory Open windows command prompt and then enter the following command. javaw -XX:+PrintFlagsFinal | find “MaxHeapSize” Output Find ThreadStackSize , HeapSizePerGCThread Memory Open windows command prompt and then enter the following command. […]