Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Java Change ArrayList Elements

import java.util.ArrayList;

class Main {
  public static void main(String[] args) {
    ArrayList<String> languages = new ArrayList<>();

    // add elements in the array list
    languages.add("Java");
    languages.add("Kotlin");
    languages.add("C++");
    System.out.println("ArrayList: " + languages);

    // change the element of the array list
    languages.set(2, "JavaScript");
    System.out.println("Modified ArrayList: " + languages);
  }
}
Comment

PREVIOUS NEXT
Code Example
Java :: terminate function calling in java 
Java :: position of an element in infinite sorted array 
Java :: how to get length of 2d array java 
Java :: different constructiors in java and what they do explained 
Java :: compare 2 hashmap 
Java :: firestore java timestamp 
Java :: static block in java 
Java :: java to kotlin 
Java :: navigation graph setup android 
Java :: add string to array java 
Java :: one key with multiple values map java 
Java :: try catch block 
Java :: How to remove an element from a Java List? 
Java :: Add Elements in java map 
Java :: creating a properties object using a file 
Java :: join strings in java 
Java :: convert python to java 
Java :: calculate the area of two squares in java by using a method 
Java :: colors java intell print 
Java :: repeat a string in java 
Java :: map indexof java 
Java :: Java try Keyword 
Java :: android java string animations 
Java :: textfield invisible java 
Java :: Picked up _JAVA_OPTIONS: -Xmx256M intillij 
Java :: print method in java 
Java :: zweidimensionales array erstellen java 
Java :: retrofit with api key post 
Java :: validate text field netbeans emails 
Java :: skip list java 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =