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 […]
Tag: Java
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 […]
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. […]
Version 1.7.0_67 of the JVM is not suitable for this product. Version 1.8 or greater is required
Eclipse Jee 2018-09 will be launched by using java 1.8 and above. So we need to install java 1.8 or above versions, either 32 bit or 64 bit according your system supports. After installing, you need to set system environment PATH variable of JDK path like C:\Program Files\Java\jdk<version>\jre\bin Error Screen Go to –> Right Click […]
Garbage Collection
Garbage Collection In C++, programmer is responsible for the creative of new objects& for destruction of useless objects Usually the programmer is taking very much car while creating object& he is ignoring that destruction of useless objects. Due to this negligence at cretin point of time, memory may not be available for the creation of […]
Enhancement 1.6 version
Enhancement Sun people introduces, the following 2 interface in 1.6 version as the part of collection Framework. 1) NavigableSet 2) NavigableMap. NavigableSet It is the child interface of SortedSet, which defines several methods to support navigation. Ceiling(e): It returns the lowest element, which is greater than equal to e. Higher(e): Returns the lowest element which […]
struts 2 display tag styles
Struts 2 display tag styles quite different and complex so here I am going to consolidating all types of possible styles and different types options in terms of data displaying. Displays a list in an html table, formatting each item in the list according to the Column tags nested inside of this tag. Use […]
How to disable dangerous http methods in apache tomcat server
How to disable dangerous http methods in apache tomcat server Some of the http methods are dangerous and using these http methods may easily hack the application like executing the remote script execution, sql injection, click jacking etc… So dangerous http methods need to be restricted. We need to disable dangerous http method in both […]
How to check JKS certificate details in java
JKS certificate using for accessing web application through secure https protocol instead http. Assume JKS file is created but you didn’t remember some of the key details to setup in the server level like key store type, key store provider, creation date, alias name, validity, owner etc.. This article helps you to get this information. […]