Apart from the usual remove() , remove(int index) and remove(Object o) we can use 4 other methods to remove elements from LinkedList. The
addFirst and addLast methods in LinkedList
Apart from add(E e) and add(int index, E element) methods, we have addFirst and addLast methods in LinkedList to add elements. 1. [crayon-68ea1a864290e890642444-i
How to remove elements from LinkedList
In this post we will see methods on how to remove elements from LinkedList. We will see example using remove() , remove(int index) and [crayon-68ea1a8642c
How to add elements in LinkedList
In this post we will see how to add elements in LinkedList. Elements can be added to LinkedList either using add(E e) which adds elements at the end of the list OR [crayon
How to read file using Scanner in Java
In this post we will see how to read file using Scanner in Java. Scanner is a part of the java.util package. We will use Scanner.nextLine() to read the file How to read file using S
How to Copy Directory in Java Recursively
In this post we will see How to Copy Directory in Java Recursively. I have a directory “kscodes\source” and it has following folders and files inside it. Lets see an example which will
How to Delete Directory in Java
In this post we will see How to Delete Directory in Java. We will use the File.delete() method. But to use this method we need the directory to be empty. I have an directory “kscodes” a
How to Decompress Files in Java – Zip Format
In this post we will see how to decompress files in java using ZIP format. Java provides a complete package java.util.zip to perform compression/decompression. Steps to decompress files in ZIP form
How to Compress Files in Java – Zip Format
In this post we will see how to compress files in java using ZIP format. Java provides a complete package java.util.zip to perform compression/decompression. Steps to compress files in ZIP format 1
How to list Files in a Directory in java
Using the java.io.File api we will see how to list files in a directory in java. File.list() method returns array of String containing names of files