Go to advanced search

by aryank4564
Thu Apr 09, 2020 1:27 pm
Forum: Java
Topic: How to use ArrayList in multi-threaded environment?
Replies: 3
Views: 667

Re: How to use ArrayList in multi-threaded environment?

import java.util.*; class ArrayListExample{ public static void main (String[] args){ List<String> list = new ArrayList<>(); list.add("A"); list.add("B"); list.add("C"); List<String> synchronizedList = Collections.synchronizedList(list); // Starting Thread 1 new Thread( () -> { synchronized(list) { ...
by aryank4564
Fri Mar 27, 2020 10:04 am
Forum: Java
Topic: Java Tutorial
Replies: 7
Views: 4207

Re: Java Tutorial

If you want to start with Basic Java. Check out this link. This tutorial provides you a good theoretical knowledge with related examples.
I personally believe that it's good tutorials for beginners.


https://www.java8net.com
by aryank4564
Mon Mar 23, 2020 7:50 am
Forum: Java
Topic: Method in ArrayList?
Replies: 5
Views: 2579

Re: Method in ArrayList?

This is a pretty clear example of how to add data to ArrayList in python. However, if you want to learn how to append data into the ArrayList in Java. Just see the below code ArrayList<String> arrayList = new ArrayList<>(); arrayList.add("Object 1"); arrayList.add("Object 2"); System.out.println(arr...

Go to advanced search