What do you want to save?
Add Code snippet
New code examples
-
Java 2021-09-29 04:33:02
Lists - removing with iterator
List<String> names = new ArrayList<>(List.of("John Doe", "Jack Doe", "John Smith")); Iterator<String> it = names.iterator(); while (it.hasNext()) { String name = it.next(); if (name.startsWith("... Add solution -
TypeScript 2021-09-28 23:06:03
reading multiple objects from file in java
FileInputStream fis = new FileInputStream("outputFile"); ArrayList<Object> objectsList = new ArrayList<>(); boolean cont = true; while (cont) { try (ObjectInputStream input = new ObjectInputStream(fis)) { Object obj = input.rea... Add solution -
Java 2021-09-23 23:25:03
Polymorphisim
Polymorphism means objects behave in different forms. ■ It occurs when parent class/interface calls to child class' objects Sub class can never be the reference type of Super Class Object ■ The reference of an object decides what is accessible. ■ Abstr... Add solution -
Java 2021-09-22 10:17:05
Create ArrayList from array java
new ArrayList<>(Arrays.asList(array)); Add solution -
Java 2021-09-22 02:56:02
array to arraylist
new ArrayList<>(Arrays.asList(array)) Add solution -
Java 2021-09-22 01:18:02
filtering out unique values from a list in java
ArrayList<String> listWithDuplicateValues = new ArrayList<>(); list.add("first"); list.add("first"); list.add("second"); ArrayList uniqueList = (ArrayList) listWithDuplicateValues.stream().distinct().collect(Coll... Add solution -
Java 2021-09-20 10:15:02
arraylist length
import java.util.ArrayList; /* * Java Program to find the length of ArrayList. * */ public class ArrayListDemo{ public static void main(String[] args) { System.out.println("Welcome to Java Program to find the length of array list"); ... Add solution -
Java 2021-09-18 13:22:02
convert arraylist to csv file java
import java.util.ArrayList; import java.io.BufferedWriter; import java.io.FileWriter; import java.io.File; import java.io.IOException; class test { public static void main(String arg[])throws IOException { ArrayList<String> list1 = n... Add solution
Best helpers
Ranking is empty